|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.protocol.http.WicketFilter
public class WicketFilter
Filter for initiating handling of Wicket requests.
For 1.3 and onward, what we do is instead of using a servlet, use a filter.
The advantage of a filter is that, unlike a servlet, it can choose not to process the request and let whatever is next in chain try. So when using a Wicket filter and a request comes in for foo.gif the filter can choose not to process it because it knows it is not a wicket-related request. Since the filter didn't process it, it falls on to the application server to try, and then it works."
for documentation| Field Summary | |
|---|---|
static java.lang.String |
APP_FACT_PARAM
The name of the context parameter that specifies application factory class |
static java.lang.String |
FILTER_MAPPING_PARAM
The name of the root path parameter that specifies the root dir of the app. |
static java.lang.String |
IGNORE_PATHS_PARAM
Name of parameter used to express a comma separated list of paths that should be ignored |
| Constructor Summary | |
|---|---|
WicketFilter()
|
|
| Method Summary | |
|---|---|
protected void |
createRequestContext(WebRequest request,
WebResponse response)
|
void |
destroy()
Servlet cleanup. |
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
As per Filter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain), is called by the container each time a
request/response pair is passed through the chain due to a client request for a resource at
the end of the chain. |
boolean |
doGet(javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse servletResponse)
Handles servlet page requests, delegating to the wicket RequestCycle system. |
protected IWebApplicationFactory |
getApplicationFactory()
Creates the web application factory instance. |
protected java.lang.ClassLoader |
getClassLoader()
|
javax.servlet.FilterConfig |
getFilterConfig()
|
protected java.lang.String |
getFilterPath(javax.servlet.http.HttpServletRequest request)
|
java.lang.String |
getRelativePath(javax.servlet.http.HttpServletRequest request)
Returns a relative path to the filter path and context root from an HttpServletRequest - use this to resolve a Wicket request. |
void |
init(javax.servlet.FilterConfig filterConfig)
As per Filter.init(FilterConfig), is called by the web container to
indicate to a filter that it is being placed into service. |
protected boolean |
isPortletContextAvailable(javax.servlet.FilterConfig config)
Tries to find if a PortletContext is available. |
protected WicketFilterPortletContext |
newWicketFilterPortletContext()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String APP_FACT_PARAM
public static final java.lang.String FILTER_MAPPING_PARAM
public static final java.lang.String IGNORE_PATHS_PARAM
| Constructor Detail |
|---|
public WicketFilter()
| Method Detail |
|---|
public void destroy()
destroy in interface javax.servlet.Filter
public void doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain)
throws java.io.IOException,
javax.servlet.ServletException
Filter.doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain), is called by the container each time a
request/response pair is passed through the chain due to a client request for a resource at
the end of the chain. The FilterChain passed in to this method allows the Filter to pass on
the request and response to the next entity in the chain.
Delegates to doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) for actual response rendering.
doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain) goes through a series of steps of steps to process a request;
WicketFilterPortletContext
retrieving the portlet specific (PortletServletRequestWrapper and
PortletServletResponseWrapper) wrapped request and response objects.
HttpServletRequest and HttpServletResponse
objects.
doGet(HttpServletRequest, HttpServletResponse) to attempt actually
rendering the response Wicket style.
doFilter in interface javax.servlet.Filterjava.io.IOException
javax.servlet.ServletExceptionWicketFilterPortletContext,
PortletServletRequestWrapper,
PortletServletResponseWrapper,
Filter.doFilter(javax.servlet.ServletRequest,
javax.servlet.ServletResponse, javax.servlet.FilterChain)
public boolean doGet(javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse servletResponse)
throws javax.servlet.ServletException,
java.io.IOException
RequestCycle system.
RequestCycle processing.
servletRequest - Servlet request objectservletResponse - Servlet response object
javax.servlet.ServletException - Thrown if something goes wrong during request handling
java.io.IOExceptionRequestCyclepublic javax.servlet.FilterConfig getFilterConfig()
public java.lang.String getRelativePath(javax.servlet.http.HttpServletRequest request)
request -
public void init(javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
Filter.init(FilterConfig), is called by the web container to
indicate to a filter that it is being placed into service.
init(FilterConfig) goes through a series of steps of steps to
initialise;
filterPath
IWebApplicationFactory and WebApplication for this filter,
including it's initialisation.
WebApplication request listeners.
Portlet context and if so intialise the
WicketFilterPortletContext
init in interface javax.servlet.Filterjavax.servlet.ServletExceptionFilter.init(javax.servlet.FilterConfig)
protected boolean isPortletContextAvailable(javax.servlet.FilterConfig config)
throws javax.servlet.ServletException
PortletContext.
config - the FilterConfig object
PortletContext was successfully loaded
javax.servlet.ServletException - on IO errorsprotected WicketFilterPortletContext newWicketFilterPortletContext()
protected void createRequestContext(WebRequest request,
WebResponse response)
protected IWebApplicationFactory getApplicationFactory()
ContextParamWebApplicationFactoryprotected java.lang.ClassLoader getClassLoader()
protected java.lang.String getFilterPath(javax.servlet.http.HttpServletRequest request)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||