Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Struts Token Interceptor - Not working

542405Apr 30 2011
Hi,

I have checked all the answers to this question on this forum but none resolve my issue.

I need to stop the user from resubmitting the form. So naturally turned to Token interceptor

I get the below warning and the page is redirected to global results for invalid.token:
Apr 10, 2011 10:50:19 PM org.apache.catalina.core.StandardContext start   
INFO: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/VulMgmt] has already been started   
Apr 10, 2011 10:51:13 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn   
WARNING: Could not find token name in params.   
Apr 10, 2011 10:51:13 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn   
WARNING: Could not find token name in params.
Here is my struts.xml config:
        <interceptors>   
            <interceptor name="mylogging" class="com.vulmgr.MyLoggingInterceptor"/>   
            <interceptor-stack name="loggingStack">   
            <interceptor-ref name="mylogging"/>   
               
                <interceptor-ref name="fileUpload">   
                    <param name="maximumSize">909715200</param>   
                    <param name="allowedTypes">   
                    text/xml,application/octet-stream   
                    </param>   
                </interceptor-ref>   
                <interceptor-ref name="defaultStack" />   
            </interceptor-stack>   
            <interceptor-stack name="token-submit" >   
                               <interceptor-ref name="tokenSession" />   
                               <interceptor-ref name="loggingStack"/>   
            </interceptor-stack>   
  
  
        </interceptors>   
        <default-interceptor-ref name="loggingStack" />   
  
        <action name="fileUpload" class="com.vulmgr.actions.FileUploadAction">   
  
            <interceptor-ref name="token-submit"/>   
            <result name="success">/WEB-INF/pages/HelloWorld.jsp</result>   
            <result name="input">/WEB-INF/pages/fileupload.jsp</result>   
            <result name="error">/WEB-INF/pages/fileupload.jsp</result>   
        </action>  
My JSP page snippest ( I have tried with out name attribute, using token, struts.token etc as name value but same issue).
    <s:form action="fileUpload" method="post" enctype="multipart/form-data">   
  
        <s:token name="doublePost"/>   
     </s:form> 

Any hints on what is missing? 


Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 28 2011
Added on Apr 30 2011
0 comments
1,326 views