You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Allen Gilliland <al...@sun.com> on 2007/05/17 21:58:53 UTC
problems with file upload parameters and custom interceptor stack
i am having a strange problem with doing file uploads using a custom
interceptor stack. basically, if my custom interceptor stack does not
directly reference the defaultStack then i am not getting request
parameters from my multipart requests. the easiest way to describe it
is by showing.
using this stack my action is properly getting request parameters set ...
<interceptor-stack name="shorterRollerStack">
<interceptor-ref name="defaultStack" />
<!-- custom Roller interceptors -->
<interceptor-ref name="UIActionInterceptor"/>
<interceptor-ref name="UISecurityInterceptor"/>
<interceptor-ref name="UIActionPrepareInterceptor"/>
</interceptor-stack>
however, using this stack my action does not get it's request parameters
properly set ...
<interceptor-stack name="rollerStack">
<interceptor-ref name="exception"/>
<interceptor-ref name="alias"/>
<interceptor-ref name="servlet-config"/>
<interceptor-ref name="prepare"/>
<interceptor-ref name="i18n"/>
<interceptor-ref name="chain"/>
<interceptor-ref name="debugging"/>
<interceptor-ref name="profiling"/>
<interceptor-ref name="scoped-model-driven"/>
<interceptor-ref name="model-driven"/>
<interceptor-ref name="fileUpload"/>
<interceptor-ref name="checkbox"/>
<interceptor-ref name="static-params"/>
<interceptor-ref name="params">
<param name="excludeParams">dojo\..*</param>
</interceptor-ref>
<interceptor-ref name="conversionError"/>
<!-- custom Roller interceptors -->
<interceptor-ref name="UIActionInterceptor"/>
<interceptor-ref name="UISecurityInterceptor"/>
<interceptor-ref name="UIActionPrepareInterceptor"/>
<!-- validation interceptors -->
<interceptor-ref name="validation">
<param name="excludeMethods">input,back,cancel,browse</param>
</interceptor-ref>
<interceptor-ref name="workflow">
<param name="excludeMethods">input,back,cancel,browse</param>
</interceptor-ref>
</interceptor-stack>
so the use case would be that if i posted a multipart request to my
action url with parameters like "?weblog=foo" plus the file upload
params then my action should have setWeblog() called. this works
properly for the first interceptor stack but not the second :/
i am trying to use the second stack which is basically the same thing as
the first one except that i had to copy what was in the defaultStack so
that i could insert my custom interceptors before the validation
interceptors. And I should note that I am looking for the value of my
parameter in the UIActionInterceptor, so I am looking for the value
before the validation and workflow interceptors are processed, not
inside my action method.
so why doesn't the second stack properly set my request parameters on my
action? i wouldn't think that the validation interceptors have anything
to do with parameter setting so it shouldn't matter that they are placed
after my custom interceptors.
-- Allen
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org