|
||||||||||
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 String |
APP_FACT_PARAM
The name of the context parameter that specifies application factory class |
static String |
FILTER_MAPPING_PARAM
The name of the root path parameter that specifies the root dir of the app. |
static String |
FILTER_PATH_ATTR
|
static 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 ClassLoader |
getClassLoader()
|
javax.servlet.FilterConfig |
getFilterConfig()
|
protected String |
getFilterPath(javax.servlet.http.HttpServletRequest request)
|
protected long |
getLastModified(javax.servlet.http.HttpServletRequest servletRequest)
Gets the last modified time stamp for the given request if the request is for a resource. |
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. |
protected WebApplication |
getWebApplication()
Gets webApplication managed by this filter |
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 String APP_FACT_PARAM
public static final String FILTER_MAPPING_PARAM
public static final String FILTER_PATH_ATTR
public static final String IGNORE_PATHS_PARAM
Constructor Detail |
---|
public WicketFilter()
Method Detail |
---|
public void destroy()
destroy
in interface javax.servlet.Filter
protected WebApplication getWebApplication()
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws 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.Filter
IOException
javax.servlet.ServletException
WicketFilterPortletContext
,
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, IOException
RequestCycle
system.
RequestCycle
processing.
servletRequest
- Servlet request objectservletResponse
- Servlet response object
javax.servlet.ServletException
- Thrown if something goes wrong during request handling
IOException
RequestCycle
public javax.servlet.FilterConfig getFilterConfig()
public 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.Filter
javax.servlet.ServletException
Filter.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()
ContextParamWebApplicationFactory
protected ClassLoader getClassLoader()
protected String getFilterPath(javax.servlet.http.HttpServletRequest request)
protected long getLastModified(javax.servlet.http.HttpServletRequest servletRequest)
servletRequest
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |