Since I upgraded from SiteMesh 2 to SiteMesh 3, my upload forms
stopped working.
Removing the SiteMesh filter brings them back to life, so there must
be a connection...
I'm using Struts2 FileUploadInterceptor. The interceptor is ignoring
my upload requests.
The relevant code is the following:
public String intercept(ActionInvocation invocation) throws
Exception {
ActionContext ac = invocation.getInvocationContext();
HttpServletRequest request = (HttpServletRequest)
ac.get(ServletActionContext.HTTP_REQUEST);
if (!(request instanceof MultiPartRequestWrapper)) {
if (LOG.isDebugEnabled()) {
LOG.debug(... very long debug message here ...)
}
return invocation.invoke();
}
When I click on my upload button, I get the debug message saying that
the action in bypassed.
That's because SiteMesh 3 is replacing the MultiPartRequestWrapper
with org.sitemesh.webapp.contentfilter.HttpServletRequestFilterable
On Thu, Feb 3, 2011 at 9:30 AM, xtian <ghz...@gmail.com> wrote: > Since I upgraded from SiteMesh 2 to SiteMesh 3, my upload forms > stopped working. > Removing the SiteMesh filter brings them back to life, so there must > be a connection...
> I'm using Struts2 FileUploadInterceptor. The interceptor is ignoring > my upload requests. > The relevant code is the following:
> public String intercept(ActionInvocation invocation) throws > Exception { > ActionContext ac = invocation.getInvocationContext(); > HttpServletRequest request = (HttpServletRequest) > ac.get(ServletActionContext.HTTP_REQUEST); > if (!(request instanceof MultiPartRequestWrapper)) { > if (LOG.isDebugEnabled()) { > LOG.debug(... very long debug message here ...) > } > return invocation.invoke(); > }
> When I click on my upload button, I get the debug message saying that > the action in bypassed. > That's because SiteMesh 3 is replacing the MultiPartRequestWrapper > with org.sitemesh.webapp.contentfilter.HttpServletRequestFilterable
> If you can send over a test case, I'll look into it what's going on.
> On Thu, Feb 3, 2011 at 9:30 AM, xtian <ghz...@gmail.com> wrote:
> > Since I upgraded from SiteMesh 2 to SiteMesh 3, my upload forms
> > stopped working.
> > Removing the SiteMesh filter brings them back to life, so there must
> > be a connection...
> > I'm using Struts2 FileUploadInterceptor. The interceptor is ignoring
> > my upload requests.
> > The relevant code is the following:
> > public String intercept(ActionInvocation invocation) throws
> > Exception {
> > ActionContext ac = invocation.getInvocationContext();
> > HttpServletRequest request = (HttpServletRequest)
> > ac.get(ServletActionContext.HTTP_REQUEST);
> > if (!(request instanceof MultiPartRequestWrapper)) {
> > if (LOG.isDebugEnabled()) {
> > LOG.debug(... very long debug message here ...)
> > }
> > return invocation.invoke();
> > }
> > When I click on my upload button, I get the debug message saying that
> > the action in bypassed.
> > That's because SiteMesh 3 is replacing the MultiPartRequestWrapper
> > with org.sitemesh.webapp.contentfilter.HttpServletRequestFilterable
On Thu, Feb 3, 2011 at 10:06 AM, xtian <ghz...@gmail.com> wrote: > I wrote a small webapp. How do I send it over?
> Apparently the behavior of struts with sitemesh 3 depends on the > invocation sequence of the filters.
> This sequence works with sitemesh not with struts upload:
> struts-prepare > sitemesh > struts-execute
> This sequence works with struts upload, not with sitemesh:
> sitemesh > struts-prepare > struts-execute
> On Feb 3, 3:34 pm, "Richard L. Burton III" <mrbur...@gmail.com> wrote: > > If you can send over a test case, I'll look into it what's going on.
> > On Thu, Feb 3, 2011 at 9:30 AM, xtian <ghz...@gmail.com> wrote: > > > Since I upgraded from SiteMesh 2 to SiteMesh 3, my upload forms > > > stopped working. > > > Removing the SiteMesh filter brings them back to life, so there must > > > be a connection...
> > > I'm using Struts2 FileUploadInterceptor. The interceptor is ignoring > > > my upload requests. > > > The relevant code is the following:
> > > public String intercept(ActionInvocation invocation) throws > > > Exception { > > > ActionContext ac = invocation.getInvocationContext(); > > > HttpServletRequest request = (HttpServletRequest) > > > ac.get(ServletActionContext.HTTP_REQUEST); > > > if (!(request instanceof MultiPartRequestWrapper)) { > > > if (LOG.isDebugEnabled()) { > > > LOG.debug(... very long debug message here ...) > > > } > > > return invocation.invoke(); > > > }
> > > When I click on my upload button, I get the debug message saying that > > > the action in bypassed. > > > That's because SiteMesh 3 is replacing the MultiPartRequestWrapper > > > with org.sitemesh.webapp.contentfilter.HttpServletRequestFilterable
These lines must be added to
org.apache.struts2.interceptor.FileUploadInterceptor, in the "public
String intercept(ActionInvocation invocation)" method, just after
"HttpServletRequest request = ..."
To patch this class you just need to copy its source to your
application, keeping it in the original package.
On Feb 3, 4:10 pm, "Richard L. Burton III" <mrbur...@gmail.com> wrote:
> > On Feb 3, 3:34 pm, "Richard L. Burton III" <mrbur...@gmail.com> wrote:
> > > If you can send over a test case, I'll look into it what's going on.
> > > On Thu, Feb 3, 2011 at 9:30 AM, xtian <ghz...@gmail.com> wrote:
> > > > Since I upgraded from SiteMesh 2 to SiteMesh 3, my upload forms
> > > > stopped working.
> > > > Removing the SiteMesh filter brings them back to life, so there must
> > > > be a connection...
> > > > I'm using Struts2 FileUploadInterceptor. The interceptor is ignoring
> > > > my upload requests.
> > > > The relevant code is the following:
> > > > When I click on my upload button, I get the debug message saying that
> > > > the action in bypassed.
> > > > That's because SiteMesh 3 is replacing the MultiPartRequestWrapper
> > > > with org.sitemesh.webapp.contentfilter.HttpServletRequestFilterable
> These lines must be added to > org.apache.struts2.interceptor.FileUploadInterceptor, in the "public > String intercept(ActionInvocation invocation)" method, just after > "HttpServletRequest request = ..."
> To patch this class you just need to copy its source to your > application, keeping it in the original package.
> On Feb 3, 4:10 pm, "Richard L. Burton III" <mrbur...@gmail.com> wrote: > > mrburton (at) gmail.com would work.
> > On Thu, Feb 3, 2011 at 10:06 AM, xtian <ghz...@gmail.com> wrote: > > > I wrote a small webapp. How do I send it over?
> > > Apparently the behavior of struts with sitemesh 3 depends on the > > > invocation sequence of the filters.
> > > This sequence works with sitemesh not with struts upload:
> > > On Feb 3, 3:34 pm, "Richard L. Burton III" <mrbur...@gmail.com> > wrote: > > > > If you can send over a test case, I'll look into it what's going on.
> > > > On Thu, Feb 3, 2011 at 9:30 AM, xtian <ghz...@gmail.com> wrote: > > > > > Since I upgraded from SiteMesh 2 to SiteMesh 3, my upload forms > > > > > stopped working. > > > > > Removing the SiteMesh filter brings them back to life, so there > must > > > > > be a connection...
> > > > > I'm using Struts2 FileUploadInterceptor. The interceptor is > ignoring > > > > > my upload requests. > > > > > The relevant code is the following:
> > > > > When I click on my upload button, I get the debug message saying > that > > > > > the action in bypassed. > > > > > That's because SiteMesh 3 is replacing the MultiPartRequestWrapper > > > > > with > org.sitemesh.webapp.contentfilter.HttpServletRequestFilterable