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)
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 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)
IWebApplicationFactory
createApplication
in interface IWebApplicationFactory
filter
- the wicket filterIWebApplicationFactory.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 filterorg.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 IWebApplicationFactory
filter
- the wicket filterCopyright © 2006–2022 Apache Software Foundation. All rights reserved.