My question is : from basic which are the necessary jars that should required in Spring and how could we configure Spring project ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Go to Spring home page and download Spring (Here, i am using 2.5.x version)
After installing, put the following jar in your classpath
<SPRING_HOME>/dist/spring.jar
Here goes a single bean
…
Write a single xml to configure your beans as follows
Put your app.xml in root classpath
And your psvm
UPDATE
When using getBean method, it behaves like a Factory pattern. Something like
As said by Spring in Action book
But, There is more
Suppose here goes messages.properties (root of the classpath)
To enable i18n, You must define a bean called messageSource to get advantage of our resource, as follows
Now, you can use it
Usually, we do not need to define all of our beans in xml file. You can use annotations (Additional settings needed to enable component scanning) instead of xml, Something like
Component annotation says:
A good resource about Spring is either Spring in Action book or Spring documentation
Advice: read carefully