Sunday, December 18, 2011

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.

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:

Blog Widget by LinkWithin

JS-Kit Comments

  © Blogger template Newspaper III by Ourblogtemplates.com 2008

Back to TOP