com.atlassian.bamboo.ww2
Class StrutsPrepareFilter
java.lang.Object
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter
com.atlassian.bamboo.ww2.StrutsPrepareFilter
- All Implemented Interfaces:
- javax.servlet.Filter, org.apache.struts2.StrutsStatics
public class StrutsPrepareFilter
- extends org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter
Among other things, this org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter wraps the original request and consumes the input stream.
This is not desirable in all cases - servlets behind this URL pattern have to handle that (_especially_ if they handle file uploads).
For example, UPM cannot.
Setting that filter too narrowly will make stale ActionContexts visible in subsequent requests. (Action contexts can get created any time)
This happens when request processing that does not include cleanup filter in its stack manipulates the ActionContext.
This filter fixes this by delegating filtering only to specific URLs, but cleaning all of them.
Fields inherited from class org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter |
excludedPatterns, prepare, REQUEST_EXCLUDED_FROM_ACTION_MAPPING |
Fields inherited from interface org.apache.struts2.StrutsStatics |
HTTP_REQUEST, HTTP_RESPONSE, PAGE_CONTEXT, SERVLET_CONTEXT, SERVLET_DISPATCHER, STRUTS_ACTION_TAG_INVOCATION, STRUTS_PORTLET_CONTEXT |
Method Summary |
void |
doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain)
|
void |
init(javax.servlet.FilterConfig filterConfig)
|
Methods inherited from class org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter |
destroy, postInit |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StrutsPrepareFilter
public StrutsPrepareFilter()
init
public void init(javax.servlet.FilterConfig filterConfig)
throws javax.servlet.ServletException
- Specified by:
init
in interface javax.servlet.Filter
- Overrides:
init
in class org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter
- Throws:
javax.servlet.ServletException
doFilter
public void doFilter(javax.servlet.ServletRequest req,
javax.servlet.ServletResponse res,
javax.servlet.FilterChain chain)
throws IOException,
javax.servlet.ServletException
- Specified by:
doFilter
in interface javax.servlet.Filter
- Overrides:
doFilter
in class org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter
- Throws:
IOException
javax.servlet.ServletException
Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.