You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Bruno Viana (JIRA)" <ji...@apache.org> on 2007/04/12 17:33:51 UTC
[jira] Commented: (WW-1880) File Uploads not reproducable (after
first time success)
[ https://issues.apache.org/struts/browse/WW-1880?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_40782 ]
Bruno Viana commented on WW-1880:
---------------------------------
Attempt to
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Change it to
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping>
The FileDispatcher fails to cleaning up your context when you make a request that isn't mapped in struts.xml. For instance, if you make a request such mycss.css, struts doesn't clean up your context and your interceptor will fail in the next time.
But, if you change /* to *.action in your web.xml, struts will not process request shuch *.css, *.js, etc.
Of course that your solution works fine too because you'll force a context cleaning.
> File Uploads not reproducable (after first time success)
> --------------------------------------------------------
>
> Key: WW-1880
> URL: https://issues.apache.org/struts/browse/WW-1880
> Project: Struts 2
> Issue Type: Bug
> Affects Versions: 2.0.6
> Environment: linux (ubuntu edgy), amd64, jboss405, SUN150
> Reporter: Andy Brook
>
> I'm not sure if this is a bug, is a documentation issue or a feature enhancement...
> Scenario:
> A form, with multiple uploads, I used the code from the showcase as a template. The first multi-file upload works fine. the second attempt using exactly the same form and files fails with 'empty' form File values. I finally found this thread which finally gave me the solution:-
> http://www.nabble.com/struts2-file-upload-very-unreliable--t3148047s2369.html
> In order to use file upload in struts 2.06, I have to modify the web.xml to include two 'struts-cleanup' chunks. With the changes it works, without, it fails:-
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
> <display-name>ITDS Order Processing application</display-name>
> <filter>
> <filter-name>struts-cleanup</filter-name>
> <filter-class>org.apache.struts2.dispatcher.ActionContextCleanUp</filter-class>
> </filter>
> <filter>
> <filter-name>struts2</filter-name>
> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
> </filter>
>
> <filter-mapping>
> <filter-name>struts-cleanup</filter-name>
> <url-pattern>/*</url-pattern>
> </filter-mapping>
> <filter-mapping>
> <filter-name>struts2</filter-name>
> <url-pattern>/*</url-pattern>
> </filter-mapping>
> <welcome-file-list>
> <welcome-file>index.html</welcome-file>
> </welcome-file-list>
>
> </web-app>
> ---
> With all the coding by expectation, should this need to be done? I haven't read into it further but it solves the file upload problem. I's there an issue in the File Upload not clearing up session state properly requiring these changes?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.