I'm developing a struts2 (2.1.8) web app. I want to use execAndWait interceptor in order to show a wait page while the uploaded file is processed.
After soving the thread problem (execAndWait Interceptor not redirecting to success page after waiting), I haven't a NPE accessing to getText() method I continue having some problems.
If debug the action execution all the jsp form variables (including the file that is uploaded) are ok (with debug inspector I could see the file path, the contentType, the filename), but the file is not in the directori it has to be:
C:\apps\apache-tomcat-6.0.39\work\Catalina\localhost\validador\upload_24cd6d23_a0ec_4887_a47c_7af1f5b703d1_00000002.tmp
I've also read this post: Cannot find file source when processing file with execAndWait interceptor of struts-jquery
But I've already declared a custom interceptor stack including the default-stack:
<interceptors>
<interceptor name="execAndWaitExtended" class="aoc.interceptor.myExecuteAndWaitInterceptor"></interceptor>
<interceptor-stack name="waitStack">
<interceptor-ref name="defaultStack" />
<interceptor-ref name="execAndWaitExtended" />
</interceptor-stack>
</interceptors>
my Action declaration:
<package name="default" namespace="/" extends="struts-default" >
...
<action name="uploadUpdatePDF" class="aoc.action.signature.UpdatePDFUpload">
<interceptor-ref name="waitStack"/>
<result type="tiles" name="input">tilesDef.validacioUpdatePDF</result>
<result name="wait">pages/wait.jsp</result>
<result type="tiles" name="sucess">tilesDef.validacioUpdatePDFResult</result>
</action>
Understanding the Thread issue is solved, and the filename or filepath from the uploaded file seems ok debuging, I don't understand why the file isn't actually stored in the server directory (and it worked fine before execAndWait interceptor was added).
Any suggestion?