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.

Reply via email to