Accessing the Java Spring Container
How to access the java Spring Container:
Java Spring is an open source, lightweight, application framework that is intended to help structure entire applications in a consistent manner, pulling together best of breed single-tier frameworks in
a coherent architecture.
a coherent architecture.
From Stand-alone:
ApplicationContext context = new
ClassPathXmlApplicationContext(APP_CONTEXT_CLASSPATH);
(APP_CONTEXT_CLASSPATH is spring/pam-contact-loader-spring-context.xml)
From Web Application
ApplicationContext context =
WebApplicationContextUtils.getWebApplicationContext(
pRequest.getSession().getServletContext());
web.xml modification
<ltcontext-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/spring/pam-spring-context.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listenerclass>
</listener>
0 comments:
Post a Comment