Spring is the facto enterprise server and integration tool in Investment banks. This IOC based development and hosting service become very popular for java based service development. We should be clear on basic concept and usage of spring for any java based technical interview. The Spring Framework
is an open source application framework and Inversion of control container for
the Java platform. This framework reduce the cost and burden of application server and provided more flexibility to developers. Spring core module details.
The Spring Framework comprises several modules that
provide a range of services:
- Inversion of Control container: configuration of application components and lifecycle management of Java objects, done mainly via Dependency Injection
- Aspect-oriented programming: enables implementation of cross-cutting routines
- Data access: working with relational database management systems on the Java platform using JDBC and object-relational mapping tools and with NoSQL databases
- Transaction management: unifies several transaction management APIs and coordinates transactions for Java objects
- Model-view-controller: an HTTP- and servlet-based framework providing hooks for extension and customization for web applications and RESTful web services.
- Remote Access framework: configurative RPC-style export and import of Java objects over networks supporting RMI, CORBA and HTTP-based protocols including web services (SOAP)
- Convention-over-configuration: a rapid application development solution for Spring-based enterprise applications is offered in the Spring Roo module
- Batch processing: a framework for high-volume processing featuring reusable functions including logging/tracing, transaction management, job processing statistics, job restart, skip, and resource management
- Authentication and authorization: configurable security processes that support a range of standards, protocols, tools and practices via the Spring Security sub-project (formerly Acegi Security System for Spring).
- Remote Management: configurative exposure and management of Java objects for local or remote configuration via JMX
- Messaging: configurative registration of message listener objects for transparent message-consumption from message queues via JMS, improvement of message sending over standard JMS APIs
- Testing: support classes for writing unit tests and integration tests.
Spring Interview Questions
1) What is
Spring Framework?
Spring is a
lightweight inversion of control and aspect-oriented container framework.
Spring Framework’s contribution towards java community
is immense and spring community is the largest and most innovative community by
size. They have numerous projects under their portfolio and have their own spring dm server for running spring applications.
This community is acquired by VMWare, a leading cloud compting company for
enabling the java application in the cloud by using spring stacks. If you are
looking to read more about the spring framework and its products, please read
in their official site Spring Source.
2) Explain
Spring?
- Lightweight : Spring is lightweight when it comes to size and transparency. The basic version of spring framework is around 1MB. And the processing overhead is also very negligible.
- Inversion of control (IoC) : Loose coupling is achieved in spring using the technique Inversion of Control. The objects give their dependencies instead of creating or looking for dependent objects.
- Aspect oriented (AOP) : Spring supports Aspect oriented programming and enables cohesive development by separating application business logic from system services.
- Container : Spring contains and manages the life cycle and configuration of application objects.
- Framework : Spring provides most of the intra functionality leaving rest of the coding to the developer.
3) What are
the different modules in Spring framework?
The Core container module
- Application context module
- AOP module (Aspect Oriented Programming)
- JDBC abstraction and DAO module
- O/R mapping integration module (Object/Relational)
- Web module
- MVC framework module
4) What is the structure of Spring framework?
DAO
ORM
AOP
JEE
CORE
WEB
5) What is
the Core container module?
This module is provides the fundamental
functionality of the spring framework. In this module BeanFactory is the
heart of any spring-based application. The entire framework was built on the
top of this module. This module makes the Spring container.
6) What is
Application context module?
The Application context module makes spring a
framework. This module extends the concept of BeanFactory,
providing support for internationalization (I18N) messages, application
lifecycle events, and validation. This module also supplies many enterprise
services such JNDI access, EJB integration, remoting, and
scheduling. It also provides support to other framework.
7) What is
AOP module?
The AOP module is used for developing
aspects for our Spring-enabled application. Much of the support has been
provided by the AOP Alliance in order to ensure the interoperability between Spring
and other AOP frameworks. This module also introduces metadata
programming to Spring. Using Spring’s metadata support, we will
be able to add annotations to our source code that instruct Spring
on where and how to apply aspects.
8) What is
JDBC abstraction and DAO module?
Using this module we can keep up the database code
clean and simple, and prevent problems that result from a failure to close
database resources. A new layer of meaningful exceptions on top of the error
messages given by several database servers is bought in this module. In
addition, this module uses Spring’s AOP module to provide
transaction management services for objects in a Spring application.
9) What are
object/relational mapping integration module?
Spring also supports for using of an
object/relational mapping (ORM) tool over straight JDBC by providing the ORM
module. Spring provide support to tie into several popular ORM frameworks,
including Hibernate,
JDO, and iBATIS SQL Maps. Spring’s transaction
management supports each of these ORM frameworks as well as JDBC.
10) What is
web module?
This module is built on the application context
module, providing a context that is appropriate for web-based applications.
This module also contains support for several web-oriented tasks such as
transparently handling multipart requests for file uploads and programmatic
binding of request parameters to your business objects. It also contains
integration support with Jakarta Struts.
11) What is Spring Mvc?
Spring comes with a full-featured MVC framework for
building web applications. Although Spring can easily be integrated with other
MVC frameworks, such as Struts, Spring’s MVC framework uses IoC to provide for
a clean separation of controller logic from business objects. It also allows
you to decoratively bind request parameters to your business objects. It also
can take advantage of any of Spring’s other services, such as I18N messaging
and validation.
12) What is
a BeanFactory?
A BeanFactory is an implementation of the factory
pattern that applies Inversion of Control to separate the application’s
configuration and dependencies from the actual application code.
13) What is
AOP Alliance?
AOP Alliance is an open-source project whose goal
is to promote adoption of AOP and interoperability among different AOP
implementations by defining a common set of interfaces and components. We can use Spring AOP module or we can integrate services with AspectJ. We can only advice method join points using Spring AOP.
Spring AOP works on concept of proxies using JDK dynamic proxies or CGLIB.
Spring AOP works on concept of proxies using JDK dynamic proxies or CGLIB.
14) What is
Spring configuration file?
Spring configuration file is an XML file. This file
contains the classes information and describes how these classes are configured
and introduced to each other.
15) What
does a simple spring application contain?
These applications are like any Java application.
They are made up of several classes, each performing a specific purpose within
the application. But these classes are configured and introduced to each other
through an XML file. This XML file describes how to configure the classes,
known as the Spring configuration file.
16) What is
XMLBeanFactory?
BeanFactory has many
implementations in Spring. But one of the most useful one is org.springframework.beans.factory.xml.XmlBeanFactory,
which loads its beans based on the definitions contained in an XML file. To
create an XmlBeanFactory, pass a java.io.InputStream to the
constructor. The InputStream will provide the XML to the factory.
For example, the following code snippet uses a java.io.FileInputStream
to provide a bean definition XML file to XmlBeanFactory.
BeanFactory factory = new XmlBeanFactory( new FileInputStream("beans.xml")); |
To retrieve the bean from a BeanFactory, call the
getBean() method by passing the name of the bean you want to retrieve.
MyBean myBean = (MyBean) factory.getBean("myBean");
|
17) What are
important ApplicationContext implementations in spring framework?
- ClassPathXmlApplicationContext – This context loads a context definition from an XML file located in the class path, treating context definition files as class path resources.
- FileSystemXmlApplicationContext – This context loads a context definition from an XML file in the filesystem.
- XmlWebApplicationContext – This context loads the context definitions from an XML file contained within a web application.
18) Explain
Bean lifecycle in Spring framework?
The spring container finds the bean’s definition from the XML file
and instantiates the bean.
- Using the dependency injection, spring populates all of the
properties as specified in the bean definition.
- If the bean implements the BeanNameAware interface, the
factory calls setBeanName() passing the bean’s ID.
- If the bean implements the BeanFactoryAware interface, the
factory calls setBeanFactory(), passing an instance of itself.
- If there are any BeanPostProcessors associated with the
bean, their post- ProcessBeforeInitialization() methods will be
called.
- If an init-method is specified for the bean, it will be called.
- Finally, if there are any BeanPostProcessors associated with
the bean, their postProcessAfterInitialization() methods will be
called.
19) What is
bean wiring?
Combining together beans within the Spring
container is known as bean wiring or wiring. When wiring beans, you should tell
the container what beans are needed and how the container should use dependency
injection to tie them together.
20) How do
add a bean in spring application?
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<bean name="/helloWorld" class="test.HelloWorldController">
|
In the bean tag the id attribute specifies the bean
name and the class attribute specifies the fully qualified class name.
21) What are
singleton beans and how can you create prototype beans?
Beans defined in spring framework are singleton
beans. There is an attribute in bean tag named ‘singleton’ if specified true
then bean becomes singleton and if set to false then the bean becomes a
prototype bean. By default it is set to true. So, all the beans in spring
framework are by default singleton beans.
< bean
|
22) What are
the important beans lifecycle methods?
There are two important bean lifecycle methods. The
first one is setup which is called when the bean is loaded in to the container.
The second method is the teardown method which is called when the bean is
unloaded from the container.
23) How can
you override beans default lifecycle methods?
The bean tag has two more important attributes with
which you can define your own custom initialization and destroy methods. Here I
have shown a small demonstration. Two new methods fooSetup and fooTeardown are
to be added to your Foo class.
init-method="fooSetup" destroy="fooTeardown">;
|
24) What are
Inner Beans?
When wiring beans, if a bean element is embedded to
a property tag directly, then that bean is said to the Inner Bean. The drawback
of this bean is that it cannot be reused anywhere else.
25) What are
the different types of bean injections?
There are two types of bean injections.
- By setter
- By constructor
very nice. for java examples, visit java2novice.com site
ReplyDeletereally nice and great article to read
ReplyDeletecore java training institute in chennai | core java training topics | core java training in chennai | core java training online
It is really a great work and the way in which u r sharing the knowledge is excellent.
ReplyDeleteThanks for helping me to understand basic concepts. As a beginner in java programming your post help me a lot.Thanks for your informative article.java training in chennai
nice article.
ReplyDeleteSpringTutorial
Thanks for sharing the very useful info about Spring and please keep updating........
ReplyDeleteThanks a lot! You made a new blog entry to answer my question; I really appreciate your time and effort.Its very valuable to me thanku so much for this interesting blog
ReplyDeletecore java training in chennai |
best java training institute in chennai
This information you provided in the blog that is really unique I love it!! Thanks for sharing such a great blog Keep posting..
ReplyDeleteSpring Interview Questions and Answers
Nice Post! It is really interesting to read from the beginning & I would like to share your blog to my circles, keep sharing… Full Stack Training in Hyderabad
ReplyDeleteNice article.. very interesting and useful, keep sharing!!
ReplyDeleteDevOps Online Training
ReplyDeleteHere is STUCORNER the Best IT training institute in Laxmi Nagar you can visit their site:
Best Training institute for IT training
Best .net Training institute
Best Foreign Language Training institute
Best Cloud Computing Training institute
Best SQT Training institute
Best CandC++ Training institute
Best Autocad Training institute
Best Digital Marketing Training institute
Best hadoop Training institute
Best CSP Training institute
I prefer to study this kind of material. Nicely written information in this post, the quality of content is fine and the conclusion is lovely. Things are very open and intensely clear explanation of issues
ReplyDeleteBest Spring Classroom Training Institute
Best Devops Classroom Training Institute
Best Corejava Classroom Training Institute
Best Advanced Classroom Training Institute
thanks for the bulk list of question and answer ,these questions are so helpful for interview preparation
ReplyDeleteDot Net Coaching Centers in Chennai
Manual Testing Training in Chennai
Core Java Training in Chennai
Best PHP Course in Chennai
norton activation
ReplyDeletewww mcafee activate
norton product key activation
AVG Antivirus phone number
Microsoft Edge Customer Service Number
kaspersky customer service Phone number
Outlook Customer service number
Comcast support number
webroot customer service number
Thanks for sharing such a nice Blog.I like it
ReplyDeleteWhy Play Games Online?
Thanks For Sharing The Information The Information Shared Is Very Valuable Please Keep Updating Us Time Just Went On Reading The article
ReplyDeleteMobile Repairing Institute in Najafgarh
Mobile repairing Institute in Nehru Place
Best computer courses after 12th
best short term courses in delhi
best vocational courses in delhi
Very nice collection of courses for managers. Keep sharing more courses for other streams also. Thanks.
ReplyDeleteOnline fitness equipments
website designing company in gurgaon
Best Hotels in mussoorie
I am really happy with your blog because your article is very unique and powerful for new reader.prefer to study this kind of material. Nicely written information in this post,the quality of content is fine and the conclusion is lovely. Things are very open and intensely clear explanation of issues.
ReplyDeletehttps://www.acte.in/php-training-in-chennai
https://www.acte.in/machine-learning-training-in-chennai
https://www.acte.in/iot-training-in-chennai
https://www.acte.in/blockchain-training-in-chennai
https://www.acte.in/openstack-training-in-chennai
This is the exact information I am been searching for, Thanks for sharing the required information with the clear update and required points. To appreciate this I like to share some useful information I’ll bookmark your weblog and check again here regularly. I am quite sure I will learn much new stuff right here!
ReplyDeleteSalesforce Training in Chennai | Certification | Online Course | Salesforce Training in Bangalore | Certification | Online Course | Salesforce Training in Hyderabad | Certification | Online Course | Salesforce Training in Pune | Certification | Online Course | Salesforce Online Training | Salesforce Training
Good and very well written blog this blog has excellent knowledgeable content and has been immensely helpful and understanding various concepts and theory
ReplyDeletejava certification training
java course
java training
best java course
Great post.
ReplyDeletehttps://www.producthunt.com/@james_larue
Nice article...
ReplyDeleteSAP pm training
SAP PP training
SAP Qm training
SAP Sd training
Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.
ReplyDeleteJava Training in Chennai
Java Training in Velachery
Java Training in Tambaram
Java Training in Porur
Java Training in OMR
Java Training in Annanagar
ReplyDeleteThank you for sharing wonderful information with us to get some idea about it.
Mulesoft Online Training in Hyderabad
Mulesoft Training in Hyderabad
Awesome blog. It was very informative. I would like to appreciate you. Keep updated like this!
ReplyDeleteSpring Boot and Micro services Training in Gurgaon
Java Training in Gurgaon
Android Training in Gurgaon
Mendixis a RAD tool that lets you create applications quickly. This is possible because Mendix is a complete development platform, providing you with the tools and services to quickly build, test, and deploy
ReplyDeleteHelpful shared content.
ReplyDeletePlease take a look to our website.
We provide very cheap rate reseller hosting and website hosting services.
Please visit our website and let us know in our comment box.
www.microcen.com
Many email users are facing a common problem i.e. forgetting the password of their email account. If any Yahoo email user wants to know about Yahoo mail forgot password and security question. If you have any problem with your Yahoo account or you cannot head your Yahoo account after many attempts then you can go to Yahoo mail forgot password and security question
ReplyDeleteHow Yahoo mail forgot password and security question
How Yahoo account recovery phone number
How To Recover Yahoo Mail Account
Cannot Login To Yahoo Mail
Yahoo mail Login USal
We analyse and Compare Energy Suppliers to find you the right deal on gas and electricity prices and then manage the whole process of energy Switching for you
ReplyDeleteDue to the fixed energy rates, the third party energy suppliers can become your first choice.
How do I switch energy supplier for my business, As a customer, you can get the fixed-rate energy plans. It doesn't matter what the current market rate of electricity is, the customers will pay only the set price.
compare gas and electric
Before you compare gas and electricity, this becomes a big benefit through third-party energy suppliers.
At RT Utilities we provide cheap gas and electricity rates You can expect to get flexible energy agreements with third-party energy suppliers. If you compare energy prices and bills, it might be easy to know how to reduce them. In the same situation, one should always know that third party energy suppliers have a limited geographic range. Hence, there are some drawbacks you can get with these energy suppliers.
" AOL Mail Not Updating | AOL Mail Not Updating on Iphone
ReplyDeleteAOL Mail Not Updating | AOL Mail Not Updating on Iphone. It might be a very common issue for users who is not able to catch their emails."
how to delete aol email? When it comes to deleting your email account without closing the proper account then it is not possible as it means that you are going to lose your things on the services that include Instant Messenger for the emails. All the emails and address books are going to delete permanently after 90 days. So you are not able to recover the account after 90 days.
ReplyDeleteHow to delete AOL email in bulk for save your time
So when it comes to deleting your email address then you have to do a lot of things also. Instead of that, you are also able to reactivate a well and get the address book back to do. If you want to know how to delete AOL mail folders to delete all the AOL mail, you need to keep up a consideration towards email. As the different processes need to follow a different types of procedures.
Very nice and informative blog keep posting this type of blogs everyday. this one is helping many online users around the globe & i have one more link to help online users exploring the information on the Internet you can get favourable results. But still, you are not sure why AOL not working then has to implement some general troubleshooting solutions to resolve these types of issues. As sometimes AOL software not working and it will give you a lot of hurdles.
ReplyDeleteAol mail not updating
Make Make AOL my Homepage You can make AOL your default landing page from the AOL site or from your records if you have one. Then again, change the settings in your program. Remember that programs can show home pages in reverse when you are using tabs. For example, Internet Explorer opens your landing page when you open the new tab page. Firefox and Chrome can’t do this as a result, so you may have to physically open your landing page in a new tab by selecting the program’s home or start page icon. Open “make aol my homepage“, search for the “AOL Build My Landing Page” standard, and select it. Follow the directions and confirmation prompts to set up the site as your landing page. In Internet Explorer and Chrome, you add an easy route to AOL that changes your default landing page setting; Similarly, Firefox allows you to change your landing page by dragging the AOL logo onto your landing page symbol.
ReplyDeleteChange your home page in browsers
In Internet Explorer, set up your landing page via Internet Options in the Tools menu; These options highlight a Home segment where you can simply enter “Make AOL my Homepage” In Firefox, change your landing page settings to “Choice” in the open menu instrument, the symbol with the three even lines. Enter “make aol my homepage” in the landing page field; You can also choose whether to have Firefox open AOL on startup here. For Chrome, select “Modify and control Google Chrome” — the symbol with the three-level lines — and use the Settings menu to make changes. You can guide Chrome to show you when AOL opens and set that as your landing page.
Punjabi Video Songs MP3 Download
ReplyDeleteNew Punjabi Video Songs Download
Top Punjabi Singers
Badshah
Jass Manak
Mankirt Aulakh
Sidhu Moose Wala
Millind Gaba
Haryanvi Video Song MP3 Download
Sapna Choudhary k Gane
New Haryanvi Video Download
Nice Blog, it is very impressive.
ReplyDeleteJava Online Course
Java Training in Chennai
Java Training in Bangalore
Nice Blog…!! Thanks for sharing this article. If you want to be a Mobile Expert. Check out for Mobile Repairing Course In Delhi India .
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteaz 104 interview questions
ReplyDeletescrum master interview questions
dp 900 interview questions
Pogo com Login Page | Pogo Games Login
ReplyDeleteThere is no charge for using the site. If you don't want to pay the monthly fee and want to join Club Pogo Login, you can still play games on the site by registering a free account. You can access all the free games on the website, and you can save your progress so that you don't have to restart every time you play the game. You can still chat with other players online and post on the forum to make it more social. You can also take part in daily challenges, but you cannot participate in the advanced challenges offered on the website.
Paypal Login my Account
Www Paypal Login
Pogo Com Login Page
Www paypal Com Login
If you want change aol password Visit the AOL My Account page. Link Below
ReplyDeleteHow to change aol password
AOL Com Homepage
ReplyDeleteSimple Guide to Install AOL Desktop Gold Link Below_
ReplyDeleteHow do I Reinstall AOL Gold
We will first check your requirements carefully, and then provide you with solutions and services. It definitely depends on your more relaxed work scene. Let's take a look at the four options we typically offer consumers for AOL backups: Link Below_
ReplyDeleteForgot AOL Mail Password
You have posted such a nice blog. Please check the link below for more information.
ReplyDeleteMake Aol my Homepage
AOL Email on iPhone not working
I was looking at your post i found that your post are very helpful and informative. I want you to know that you are doing a great job please keep posting this type of blogs and posts regularly apart from that i also have something very interesting and informative that can help everyone i am pasting few links below so you can check that out for more details. Thankyou !
ReplyDeleteAol Not Working on iphone
Contact Aol
You have posted such a nice blog. Please check the link below for more information.
ReplyDeleteAol Mail Change Password
You have posted a very nice and informative blog. keep posting this type of blog regularly. I also have something very interesting you can check the links below.
ReplyDeleteHelp Aol Com
Forgot Aol Password
smm panel
ReplyDeletesmm panel
https://isilanlariblog.com/
instagram takipçi satın al
hirdavatciburada.com
www.beyazesyateknikservisi.com.tr
servis
Jeton Hilesi
nice information thanks for sharing....!
ReplyDeletespring boot certification course training
Hi,
ReplyDeleteThank you for this helpful information.
This is an excellent and very useful article.
Thank you for providing this information, and best wishes to all who wish to participate. spoken english online training - NareshIT