Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
SiteMesh 3 breaks Struts 2 FileUploadInterceptor?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
xtian  
View profile  
 More options Feb 3 2011, 9:30 am
From: xtian <ghz...@gmail.com>
Date: Thu, 3 Feb 2011 06:30:38 -0800 (PST)
Local: Thurs, Feb 3 2011 9:30 am
Subject: SiteMesh 3 breaks Struts 2 FileUploadInterceptor?
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

Any way to fix this?
I tried with the Apache ActionContextCleanUp filter as suggested here
(http://osdir.com/ml/java.appfuse.user/2007-02/msg00096.html) but it
breaks everything.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
xtian  
View profile  
 More options Feb 3 2011, 9:32 am
From: xtian <ghz...@gmail.com>
Date: Thu, 3 Feb 2011 06:32:06 -0800 (PST)
Local: Thurs, Feb 3 2011 9:32 am
Subject: Re: SiteMesh 3 breaks Struts 2 FileUploadInterceptor?
P.S. I'm using sitemesh-3.0-alpha-1.zip

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Richard L. Burton III  
View profile  
 More options Feb 3 2011, 9:34 am
From: "Richard L. Burton III" <mrbur...@gmail.com>
Date: Thu, 3 Feb 2011 09:34:36 -0500
Local: Thurs, Feb 3 2011 9:34 am
Subject: Re: SiteMesh 3 breaks Struts 2 FileUploadInterceptor?

If you can send over a test case, I'll look into it what's going on.

--
-Richard L. Burton III

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
xtian  
View profile  
 More options Feb 3 2011, 10:06 am
From: xtian <ghz...@gmail.com>
Date: Thu, 3 Feb 2011 07:06:19 -0800 (PST)
Local: Thurs, Feb 3 2011 10:06 am
Subject: Re: SiteMesh 3 breaks Struts 2 FileUploadInterceptor?
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Richard L. Burton III  
View profile  
 More options Feb 3 2011, 10:10 am
From: "Richard L. Burton III" <mrbur...@gmail.com>
Date: Thu, 3 Feb 2011 10:10:47 -0500
Local: Thurs, Feb 3 2011 10:10 am
Subject: Re: SiteMesh 3 breaks Struts 2 FileUploadInterceptor?

mrburton (at) gmail.com would work.

--
-Richard L. Burton III

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
xtian  
View profile  
 More options Feb 8 2011, 6:37 am
From: xtian <ghz...@gmail.com>
Date: Tue, 8 Feb 2011 03:37:30 -0800 (PST)
Local: Tues, Feb 8 2011 6:37 am
Subject: Re: SiteMesh 3 breaks Struts 2 FileUploadInterceptor?
While I wait for an official fix, I patched the struts
FileUploadInterceptor with a dirty hack:

        if (request instanceof
org.sitemesh.webapp.contentfilter.HttpServletRequestFilterable) {
                request = (HttpServletRequest)
((org.sitemesh.webapp.contentfilter.HttpServletRequestFilterable)request).g etRequest();
        }

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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
crashworx  
View profile  
 More options Jan 4, 7:09 pm
From: crashworx <dam...@customtag.com.au>
Date: Fri, 4 Jan 2013 16:09:35 -0800 (PST)
Local: Fri, Jan 4 2013 7:09 pm
Subject: Re: SiteMesh 3 breaks Struts 2 FileUploadInterceptor?

Hi,

did you ever find a solution to this ... i've got the same issue, using
sitemesh 3 alpha 2..


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »