I'm running an webapp in glassfish with Struts 2. My web.xml file have the following filters:
StrutsPrepareFilter
,
SiteMeshFilter
,
StrutsExecuteFilter
it works fine.
The problem is that I have a to do a file upload. For some reason it works on Tomcat, but on GlassFish the file comes null in the action.
If I change the filters to:
ActionContextCleanUp
,
SiteMeshFilter
,
FilterDispatcher
it works. The fact is that ActionContextCleanUp
and FilterDispatcher
are deprecated.
So I have 2 questions: Does anyone knows what is the issue with the glassfish file upload?
I'm trying to debug the filters to see where the file is being lost, but I don't know where in the filters are the parameters. The filter recieve a httpservletrequest with no parameter, even on tomcat.
Where are the submited parameters on filters?
I created a test project where the same problem is happening. The file is uploaded to the temporary folder then lost.
Here is the web.xml:
<welcome-file-list>
<welcome-file>upload.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>exec</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>exec</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
The same happen if I use prepare and execute filters separately.