Hi ..

I try to override the XmlWebApplicationsContext and I dont know how to register my subclass. I found in ContextLoader.java in the method determineContextClass the following code:

String contextClassame = servletContext.getInitParameter(CONTEXT_CLASS_PARAM);

I looks like I could set the class by setting this Parameter but I down know how.

In de documentation (http://ajava.org/online/spring-3.RC2-api/org/springframework/web/context/support/XmlWebApplicationContext.html), I see the following line:

For a WebApplicationContext that reads in a different bean definition format, create an analogous subclass of AbstractRefreshableWebApplicationContext. Such a context implementation can be specified as "contextClass" context-param for ContextLoader or "contextClass" init-param for FrameworkServlet.

But this does not really help me. I still dont know hat to register my subclass. Does anyone?

Thanks für every answer!

Dominic

But this does not really help me. I still dont know hat to register my subclass. Does anyone?

The same way you would register the Spring XML configuration file. In your web.xml along with specifying the context configuration location, also specify your context loader class. Something like:

<context-param>
	<param-name>contextClass</param-name>
	<param-value>net.sos.services.common.MyLoader</param-value>
</context-param>
<context-param>
	<param-name>contextConfigLocation</param-name>
	<param-value>classpath:net/sos/services/config/cxf.xml</param-value>
</context-param>

Here net.sos.services.common.MyLoader is a class which extends the AbstractRefreshableWebApplicationContext class.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.