|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.spring.SpringWebApplicationFactory
public class SpringWebApplicationFactory
Implementation of IWebApplicationFactory that pulls the WebApplication object out of spring application context. Configuration example:
<filter>
<filter-name>MyApplication</filter-name>
<filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
<init-param>
<param-name>applicationClassName</param-name>
<param-value>org.apache.wicket.spring.SpringWebApplicationFactory</param-value>
</init-param>
</filter>
applicationBean init parameter can be used if there are multiple WebApplications
defined on the spring application context.
Example:
<filter>
<filter-name>MyApplication</filter-name>
<filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
<init-param>
<param-name>applicationClassName</param-name>
<param-value>org.apache.wicket.spring.SpringWebApplicationFactory</param-value>
</init-param>
<init-param>
<param-name>applicationBean</param-name>
<param-value>phonebookApplication</param-value>
</init-param>
</filter>
This factory is also capable of creating an additional application context (path to which is
specified via the contextConfigLocation filter param) and chaining it to the global one
<filter>
<filter-name>MyApplication</filter-name>
<filter-class>org.apache.wicket.protocol.http.WicketFilter</filter-class>
<init-param>
<param-name>applicationFactoryClassName</param-name>
<param-value>org.apache.wicket.spring.SpringWebApplicationFactory</param-value>
</init-param>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:com/myapplication/customers-app/context.xml</param-value>
</init-param>
</filter>
| Constructor Summary | |
|---|---|
SpringWebApplicationFactory()
|
|
| Method Summary | |
|---|---|
WebApplication |
createApplication(WicketFilter filter)
Create application object |
protected org.springframework.web.context.ConfigurableWebApplicationContext |
createWebApplicationContext(org.springframework.web.context.WebApplicationContext parent,
WicketFilter filter)
Creates and initializes a new WebApplicationContext, with the given context as the
parent. |
void |
destroy(WicketFilter filter)
Called when the filter instance that used this factory is destroyed |
protected String |
getContextConfigLocation(WicketFilter filter)
Returns location of context config that will be used to create an additional application context for this application |
protected org.springframework.web.context.ConfigurableWebApplicationContext |
newApplicationContext()
Factory method used to create a new instance of the additional application context, by default an instance o XmlWebApplicationContext will be created. |
protected void |
postProcessWebApplicationContext(org.springframework.web.context.ConfigurableWebApplicationContext wac,
WicketFilter filter)
This is a hook for potential subclasses to perform additional processing on the context. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SpringWebApplicationFactory()
| Method Detail |
|---|
protected final String getContextConfigLocation(WicketFilter filter)
filter -
protected org.springframework.web.context.ConfigurableWebApplicationContext newApplicationContext()
XmlWebApplicationContext will be created.
public WebApplication createApplication(WicketFilter filter)
IWebApplicationFactory
createApplication in interface IWebApplicationFactoryfilter - the wicket filter
IWebApplicationFactory.createApplication(WicketFilter)
protected final org.springframework.web.context.ConfigurableWebApplicationContext createWebApplicationContext(org.springframework.web.context.WebApplicationContext parent,
WicketFilter filter)
throws org.springframework.beans.BeansException
WebApplicationContext, with the given context as the
parent. Based on the logic in FrameworkServlet#createWebApplicationContext
parent - parent application contextfilter - wicket filter
org.springframework.beans.BeansException
protected void postProcessWebApplicationContext(org.springframework.web.context.ConfigurableWebApplicationContext wac,
WicketFilter filter)
FrameworkServlet#postProcessWebApplicationContext
wac - additional application contextfilter - wicket filterpublic void destroy(WicketFilter filter)
destroy in interface IWebApplicationFactoryfilter - the wicket filter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||