Hi,
I am trying to use the execandwait interceptor for a file upload in my struts2 application but no luck.
My
jsp page that submits 'myAction' has some validations.
When I select a file and click submit, I am redirected to the wait page but then the wait page is refereshed and I am thrown back to inputPage.jsp with validation errors (File not selected).
It appears as if the action is being executed twice. Can anyone please help me.
struts.xml
<action name=myAction"
class="myActionClass" method="myMethod">
<interceptor-ref name="completeStack" />
<interceptor-ref name="execAndWait">
<param name="delay">1000</param>
<param name="delaySleepInterval">500</param>
</interceptor-ref>
<result name="wait">/WEB-INF/pages/wait.jsp</result>
<result name="success">/WEB-INF/pages/success.jsp</result>
<result name="input">/WEB-INF/pages/inputPage.jsp</result>
</action>
wait.jsp
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<meta http-equiv="refresh" content="5;url=<s:url includeParams="all" />"/>
</head>
<body>
<h1>
Struts 2 execAndWait example</h1>
<h3>Please wait while we process your request...</h3>
</body>
</html>
success.jsp
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
</head>
<body>
<h1>Struts 2 execAndWait example</h1>
<h3>Done</h3>
</body>
</html>