|
How to load parameters at application startup in Spring MVC framework |
|
|
Context loader Servlet is used in Spring framework to load parameters at application start up. Add following lines of code in web.xml to load classes at application context.
Web.xml
<servlet>
<servlet-name>context</servlet-name>
<servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/SampleSupport.xml</param-value>
</context-param>
SampleSupport.xml
<beans>
<bean id="accounting" class="springexample.services.Accounting">
</bean>
<bean id="authentication" class="springexample.services.Authentication">
</bean>
</beans>
Related Tips
|
Page 1 of 0 ( 0 comments )
You can share your information about this topic using the form below!
Please do not post your questions with this form! Thanks.