public class SpringWebApplicationFactory extends Object implements IWebApplicationFactory
<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>
</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>applicationFactoryClassName</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 a WebApplication-specific 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 and Description |
|---|
SpringWebApplicationFactory() |
| Modifier and Type | Method and Description |
|---|---|
WebApplication |
createApplication(WicketFilter filter) |
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) |
protected String |
getContextConfigLocation(WicketFilter filter)
Returns location of context config that will be used to create a
WebApplication
-specific application context. |
protected org.springframework.web.context.ConfigurableWebApplicationContext |
newApplicationContext()
Factory method used to create a new instance of the web 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.
|
protected final String getContextConfigLocation(WicketFilter filter)
WebApplication
-specific application context.filter - protected org.springframework.web.context.ConfigurableWebApplicationContext newApplicationContext()
XmlWebApplicationContext will be created.public WebApplication createApplication(WicketFilter filter)
createApplication in interface IWebApplicationFactoryIWebApplicationFactory.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#createWebApplicationContextparent - parent application contextfilter - wicket filterorg.springframework.beans.BeansExceptionprotected void postProcessWebApplicationContext(org.springframework.web.context.ConfigurableWebApplicationContext wac,
WicketFilter filter)
FrameworkServlet#postProcessWebApplicationContextwac - additional application contextfilter - wicket filterpublic void destroy(WicketFilter filter)
destroy in interface IWebApplicationFactoryCopyright © 2006–2015 Apache Software Foundation. All rights reserved.