javainterview.in - Spring









Search Preview

Spring Interview Questions

javainterview.in
Top 40 Spring Interview Questions and Answers. In-depth guide with answers to wow the interviewer. Bonus : 20+ Videos & PDF interview guide.
.in > javainterview.in

SEO audit: Content analysis

Language Error! No language localisation is found.
Title Spring Interview Questions
Text / HTML ratio 71 %
Frame Excellent! The website does not use iFrame solutions.
Flash Excellent! The website does not have any flash contents.
Keywords cloud Spring Java AOP framework MVC web package features bean implement Hibernate Interview Job related methods Batch? class method test
Keywords consistency
Keyword Content Title Description Headings
Spring 100
Java 21
AOP 18
framework 13
MVC 11
web 11
Headings
H1 H2 H3 H4 H5 H6
1 2 28 0 0 0
Images We found 7 images on this web page.

SEO Keywords (Single)

Keyword Occurrence Density
Spring 100 5.00 %
Java 21 1.05 %
AOP 18 0.90 %
framework 13 0.65 %
MVC 11 0.55 %
web 11 0.55 %
package 10 0.50 %
features 10 0.50 %
bean 10 0.50 %
implement 10 0.50 %
Hibernate 10 0.50 %
Interview 9 0.45 %
Job 9 0.45 %
related 8 0.40 %
8 0.40 %
methods 8 0.40 %
Batch? 8 0.40 %
class 8 0.40 %
method 8 0.40 %
test 7 0.35 %

SEO Keywords (Two Word)

Keyword Occurrence Density
are the 19 0.95 %
can be 18 0.90 %
What are 18 0.90 %
do you 18 0.90 %
How do 18 0.90 %
of the 16 0.80 %
in Spring 13 0.65 %
of Spring 10 0.50 %
Spring framework 10 0.50 %
What is 8 0.40 %
Spring AOP 8 0.40 %
Spring Batch? 8 0.40 %
the different 8 0.40 %
Spring MVC 7 0.35 %
is the 7 0.35 %
using Spring 7 0.35 %
in a 7 0.35 %
with Spring 7 0.35 %
to implement 6 0.30 %
a web 6 0.30 %

SEO Keywords (Three Word)

Keyword Occurrence Density Possible Spam
How do you 18 0.90 % No
What are the 18 0.90 % No
are the different 8 0.40 % No
can be used 5 0.25 % No
with Spring Batch? 4 0.20 % No
Spring framework is 4 0.20 % No
are the important 4 0.20 % No
be used to 4 0.20 % No
do you implement 4 0.20 % No
Spring AOP or 4 0.20 % No
can be configured 4 0.20 % No
cross cutting concerns 3 0.15 % No
new features in 3 0.15 % No
Gang of Four 3 0.15 % No
some of the 3 0.15 % No
a web application 3 0.15 % No
of a web 3 0.15 % No
of the new 3 0.15 % No
Job in Spring 3 0.15 % No
that we are 3 0.15 % No

SEO Keywords (Four Word)

Keyword Occurrence Density Possible Spam
What are the different 8 0.40 % No
What are the important 4 0.20 % No
can be used to 4 0.20 % No
How do you implement 4 0.20 % No
in a property file 3 0.15 % No
some of the new 3 0.15 % No
can be configured with 3 0.15 % No
of the new features 3 0.15 % No
the new features in 3 0.15 % No
new features in Spring 3 0.15 % No
of a web application 3 0.15 % No
steps with Spring Batch? 2 0.10 % No
provided by Spring test 2 0.10 % No
by Spring test framework? 2 0.10 % No
different mock objects provided 2 0.10 % No
objects provided by Spring 2 0.10 % No
mock objects provided by 2 0.10 % No
What are the utility 2 0.10 % No
the different mock objects 2 0.10 % No
are the different mock 2 0.10 % No

Internal links in - javainterview.in

In28Minutes
Java Interview Questions and Answers
Download Java Interview Pdf Guide
Java Interview PDF Guide with 400+ Questions
Popular Video Courses
20 Video Courses
Buy Java Interview Video Guide - $12.99/₹799
Get our Java Interview Video Guide
Posts (Atom)
Java Interview Questions and Answers For Freshers and Experienced
Core Java
Core Java interview questions and answers for Freshers and Experienced
Advanced Java
Advanced Java Interview Questions for Freshers and Experienced
Spring
Spring Interview Questions
Spring MVC
Spring MVC Interview Questions and Answers
Struts
Struts Interview Questions
Hibernate
Hibernate Interview Questions
Generics
Java Generics Interview Questions
Collections
Java Collections Interview Questions
Java New Features
Java New Features
Design Patterns
Java Design Patterns Interview Questions
Web Services
REST Web Services Interview Questions

Javainterview.in Spined HTML


Spring Interview Questions Toggle navigation In28Minutes Download Java Interview Pdf Guide Popular Video Courses Buy Java Interview Video Guide - $12.99/₹799 Start learning on Udemy today! Spring Interview Questions What is Dependency Injection? Why is Spring one of the most popular Java related frameworks? What are the variegated modules in Spring Framework? Can you requite an overview of a web using that is implemented using Spring related Modules? What is the simplest way of ensuring that we are using single version of all Spring related dependencies? What are the major features in variegated versions of Spring ? What are the latest specifications supported by Spring 4.0? Can you describe some of the new features in Spring 4.0? What is auto-wiring? What would happen in Spring Container finds multiple stone definitions matching the property to be wheels wired? How is Spring’s singleton stone variegated from Gang of Four Singleton Pattern? How do you represent stateful stone in Spring? How do you use values specified in a property file in an using context xml? How is validation washed-up using Spring Framework? How do you implement navigate wearing concerns in a web application? What is anSpecialityand Pointcut in AOP? What are the variegated types of AOP advices? How do you pinpoint transaction management for Spring – Hibernate integration? How do you segregate the framework to implement AOP - Spring AOP or AspectJ? What are the variegated mock objects provided by Spring test framework? What are the utility methods misogynist to test JDBC classes? How do you setup a Session Factory to integrate Spring and Hibernate? How do you implement caching with Spring framework? What are the important features of Spring Batch? What are the important concepts related to setting up a Job in Spring Batch? What are the variegated ItemReader and ItemWriter implementations misogynist with Spring Batch? How do you start running a Spring Batch Job? How do you configure parallel execution of steps with Spring Batch? What is Dependency Injection? Most java classes are dependant on a large number of other classes. For example,a ClientService will depend on ClientDO to get the data from database.SurpassingSpring Framework, ClientService matriculation would directly create an instance of ClientDO matriculation by using lawmaking like “new ClientDO()” (in constructor, for example). This introduces tight coupling between ClientService and ClientDO. If I want ClientService to use some other data instead of that provided by ClientDO, we need to reimplement ClientService. This is where Spring framework comes in. It removes tight coupling between classes. In whilom example, Spring framework would inject ClientDO into ClientService class. This concept is tabbed Dependency Injection or Inversion of Control. If needed ( when writing a unit test), we can ask Spring framework to inject a variegated matriculation (which has same interface as ClientDO). Why is Spring one of the most popular Java related frameworks? Spring framework enables minutiae of loosely coupled classes based on well specified interfaces (Dependency Injection and IOC). It makes writing testable lawmaking simple. Beauty of Spring framework is that it provides unconfined integration support with other non Spring unshut source frameworks – In specimen you would want to integrate with frameworks like AspectJ (instead of Spring AOP) or Struts 2(instead of Spring MVC). Spring framework is built upon loosely coupled Spring modules enabling us to pick and segregate the specific aspects of the Spring module we would like to use. This flexibility is what makes Spring framework one of most popular Java frameworks. What are the variegated modules in Spring Framework? The Core package provides IoC Dependency Injection BeanFactory, an implementation of the factory pattern, helps us decouple configuration and injection of dependencies from program logic. The DAO package provides an wresting over JDBC to simplify writing lawmaking that interacts with database. Declarative transaction management is an wing full-length provided by DAO package. The ORM package provides integration for Spring with most popular JPA implementations (Hibernate etc) and Query Mapping (iBatis). Spring AOP package provides a vital AOP implementation featuring definition of interceptors and pointcuts.Navigatecutting concerns like security and transaction management can be implemented using Spring AOP. Spring Web package provides multipart file-upload functionality Integration with Struts and other MVC Frameworks Spring's MVC package provides a wipe implementation of the MVC model for web applications. Can you requite an overview of a web using that is implemented using Spring related Modules?VariegatedLayers of a web using can be implemented using variegated spring modules. Beauty of Spring framework is that Spring provides unconfined integration support with other non Spring unshut source frameworks – In specimen you would want to integrate with frameworks like AspectJ (instead of Spring AOP) or Struts 2(instead of Spring MVC). Service &MerchantryLayers CoreMerchantryLogic using simple POJOs, managed by Spring's IoC container Transaction Management using Spring AOP Integration Layer Spring ORM to integrate with Databases (JPA & iBatis). Spring JMS to intergrate with external interfaces using JMS Spring WS to slosh web services. Web Layer Spring MVC to implement MVC pattern. Spring WS to expose web services. What is the simplest way of ensuring that we are using single version of all Spring related dependencies? Spring is made up of a number of small components (spring-core, spring-context, spring-aop, spring-beans and so on). One of the quirks of using Spring framework is the dependency management of these components. Simple way of doing this is using Maven "Bill Of Materials" Dependency. <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-framework-bom</artifactId> <version>4.1.6.RELEASE</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> All spring dependencies can now be included in this and the child poms without using version. <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> </dependency> <dependencies> What are the major features in variegated versions of Spring ? Spring 2.5 made annotation-driven configuration possible. Spring 3.0 made unconfined use of the Java 5 improvements in language. Spring 4.0 is the first version to fully support Java 8 features. Minimum version of Java to use Spring 4 is Java SE 6. What are the latest specifications supported by Spring 4.0? Spring Framework 4.0 supports the Java EE 7 specifications JMS 2.0 JTA 1.2 JPA 2.1StoneValidation 1.1 JSR-236 for Concurrency. Can you describe some of the new features in Spring 4.0?Pursuitare some of the new features in Spring 4.0 and Spring 4.1 spring-websocket module provides support for WebSocket-based liaison in web applications. Spring Framework 4.0 is focused on Servlet 3.0+ environments @RestController voice-over is introduced for use with Spring MVC applications Spring 4.1 introduces @JmsListener annotations to hands register JMS listener endpoints. Spring 4.1 supports JCache (JSR-107) annotations using Spring’s existing enshroud configuration. Jackson’[email protected]@ResponseBodyandResponseEntitycontroller methods for serializing variegated amounts of detail for the same POJO What is auto-wiring? The Spring container can autowire dependencies into interacting beans. Spring container can resolve dependencies by looking at the other beans specified in the ApplicationContext. This elimates the need for maintaining an xml specifying beans and their dependencies. Autowiring can be washed-up byName (name of the property) and byType (type of the property). What would happen in Spring Container finds multiple stone definitions matching the property to be wheels wired? Spring framework does not resolve this kind of ambiguity. It would throw and exception. The programmer has the nomination to remove one of the stone or explicitly wire in a dependency. How is Spring’s Singleton stone variegated from Gang of Four Singleton Pattern? The singleton telescopic is the default telescopic in Spring. The Gang of Four defines Singleton as having one and only one instance per ClassLoader. However, Spring singleton is specified as one instance of stone definition per container. How do you represent Stateful stone in Spring? Stateful beans are represented in Spring with a prototype scope. A new instance is created every time a request for stone is made. Example below. <bean id="state" class="com.foo.SomeState" scope="prototype"/> How do you use values specified in a property file in an using context xml?Pursuitexample shows how to configure a data source using the url, username and password configured in a property file (database-connection.properties) <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations" value="classpath:database-connection.properties"/> </bean> <bean id="dataSource" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="${jdbc.driverClassName}"/> <property name="url" value="${jdbc.url}"/> <property name="username" value="${jdbc.username}"/> <property name="password" value="${jdbc.password}"/> </bean> How is validation washed-up using Spring Framework? Spring validator can be used both in web and merchantry layers to validate objects. It is based on the org.springframework.validation.Validator interface having two important methods supports(Class) – does this validator support a particular matriculation validate(Object, org.springframework.validation.Errors) – validates and sets errors into Errors object An example is provided below: MessageCodesResolver can be used to convert the message lawmaking into proper internationalized text. public matriculation CarValidator implements Validator { public boolean supports(Class clazz) { return Car.class.equals(clazz); } public void validate(Object obj, Errors e) { ValidationUtils.rejectIfEmpty(e, "name", "name.is.empty"); Car c = (Car) obj; if (c.getUsedYears() < 0) { e.rejectValue("usedYears", "not.yet.bought"); } } } How do you implement navigate wearing concerns in a web application? Functionality spanning multiple layers of an using are tabbed navigate wearing concerns. Examples are logging, security, declarative transactions.Navigatecutting concerns are weightier implemented usingSpecialityOriented Programming (AOP). AOP enables us to wield the navigate wearing features wideness multiple classes. What is anSpecialityand Pointcut in AOP? Two important AOP concepts areSpeciality:Specialityis the snooping that we are trying to implement generically. Ex: logging, transaction management.Translatingis the specific speciality of the snooping we are implementing. Pointcut : An expression which determines what are the methods that theTranslatingshould be unromantic on. What are the variegated types of AOP advices?Surpassingtranslating : Executed surpassing executing the very method.Withoutreturning advice: Executed without executing the very method.Withoutthrowing translating : Executed if the very method undeniability throws an exception.Without(finally) translating : Executed in all scenarios (exception or not) without very method call. Around translating : Most powerful translating which can perform custom policies surpassing and without the method invocation. How do you pinpoint transaction management for Spring – Hibernate integration? First step is to pinpoint a a transaction manager in the xml. <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager" p:sessionFactory-ref="sessionFactory" /> <tx:annotation-driven/> Next, we can add the @Transactional voice-over on the methods which need to part of a transactions. @Transactional(readOnly = true) public matriculation CustomerDaoImpl implements CustomerDao { How do you segregate the framework to implement AOP - Spring AOP or AspectJ? Spring AOP is very simple implementation of AOP concepts. Its an platonic fit If the needs of an using are simple like Simple method executions and/or Advising the execution of operations only on spring beans AspectJ is a full fledged AOP framework that helps you Advise objects not managed by the Spring container . Advise join points other than simple method executions (for example, field get or set join points). What are the variegated mock objects provided by Spring test framework? org.springframework.mock.env package : Mock implementations of the Environment and PropertySource abstractions. org.springframework.mock.jndi package : Implementation of the JNDI SPI, which can be used to create a simple JNDI environment for test suites. org.springframework.mock.web package : Servlet API mock objects to test Spring MVC classes like controllers. What are the utility methods misogynist to test JDBC classes? JdbcTestUtils provides the pursuit static utility methods. countRowsInTable(..) & deleteFromTables(..): counts/deletes the rows in the given table countRowsInTableWhere(..) & deleteFromTableWhere(..): counts /deletes the rows in the given table, using the provided WHERE clause dropTables(..): drops the specified tables How do you setup a Session Factory to integrate Spring and Hibernate? Hibernate SessionFactory can be configured as a spring bean. <bean id="mySessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource" ref="specificDataSource"/> <property name="mappingResources"> <list> <value>tablename.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <value> hibernate.dialect=org.hibernate.dialect.HSQLDialect </value> </property> </bean> Datasource can be created from JNDI. <beans> <jee:jndi-lookup id=" specificDataSource " jndi-name="java:comp/env/jdbc/specificds"/> </beans> How do you implement caching with Spring framework? Enabling caching in Spring is all the matter of making the right annotations misogynist in towardly methods. First, we need to enable caching. This can be washed-up usingVoice-overor XML based configuration.Unelevatedexample shows enabling Spring based caching using Annotation. @Configuration @EnableCaching public matriculation AppConfig { } Next step is to add the annotations on the method we would like to enshroud results from. @Cacheable("players") public Player findPlayer(int playerId) { ... } Spring offers features to tenancy caching Conditional Caching : condition="#name.length < 32" @CachePut : Update existing cache. For example, when player details cached whilom are updated. @CacheEvict : Remove from cache. For example, the player is deleted. Spring moreover provides integration with well known caching frameworks like EhCache. Sample xml configuration shown below. <bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager" p:cache-manager-ref="ehcache"/> <!-- EhCache library setup --> <bean id="ehcache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" p:config- location="ehcache.xml"/> What are the important features of Spring Batch? Restartability : Easy to restart a batch program from where it failedVariegatedReaders and Writers : Provides unconfined support to read from JMS, JDBC, Hibernate, iBatis etc. It can write to JMS, JDBC, Hibernate and more.PermafrostProcessing : If we have 1 Million records to process, these can be processed in configurable chunks (1000 at a time or 10000 at a time). Easy to implement proper transaction management plane when using permafrost processing. Easy to implement parallel processing. With simple configuration, variegated steps can be run in parallel. What are the important concepts related to setting up a Job in Spring Batch? A Job in Spring Batch is a sequence of Steps. Each Step can be configured with next : next step to execute tasklet : task or permafrost to execute. A permafrost can be configured with a Item Reader, Item Processor and Item Writer. visualization : Decide which steps need to executed. What are the variegated ItemReader and ItemWriter implementations misogynist with Spring Batch? Important ones are those that indulge to read/write from Flat File Hibernate Cursor JDBC JMS Hibernate Paging Stored Procedure How do you start running a Spring Batch Job? A Job Launcher can be used to execute a Spring Batch Job. A job can be launched/scheduled in a web container as well. Each execution of a job is tabbed a Job Instance. Each Job Instance is provided with an execution id which can be used to restart the job (if needed). Job can be configured with parameters which can be passed to it from the Job Launcher. How do you configure parallel execution of steps with Spring Batch? To execute jobs in parallel we can use a split. Example shows configuring a split. In unelevated example, flow1 (step1 and step2 sequence) is executed in parallel with flow2 (step3). Step4 is executed without both flows are complete. <job id="job1"> <split id="split1" task-executor="taskExecutor" next="step4"> <flow> <step id="step1" parent="s1" next="step2"/> <step id="step2" parent="s2"/> </flow> <flow> <step id="step3" parent="s3"/> </flow> </split> <step id="step4" parent="s4"/> </job> If you loved these Questions, you will love our PDF Interview Guide with 400+ Questions. Download it now!. 400+ Interview Questions in 4 Categories: Java : Core Java, Advanced Java, Generics, Exception Handling, Serialization, Threads, Synchronization, Java New Features Frameworks : Spring, Spring MVC, Struts, Hibernate Design : Design, Design Patterns,LawmakingReview Architecture : Architecture, Performance & Load Testing, Web Services, REST Web Services,Security, Continuous Integration Home Subscribe to: Posts (Atom)WeightierSelling Java Interview Udemy Course 400+ Java Interview Questions 25 Java Interview Videos Core Java Advanced Java Spring Spring MVC Struts Hibernate Generics Collections Java New Features Design Patterns Web Services © Java Interview Questions and Answers For Freshers and Experienced 2013 . Powered by Bootstrap and Bootstrap Blogger Templates