struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Don Brown (JIRA)" <>
Subject [jira] Closed: (STR-1569) FormFile implementations should be serializable
Date Tue, 25 Apr 2006 19:24:45 GMT
     [ ]
Don Brown closed STR-1569:

    Resolution: Fixed

> FormFile implementations should be serializable
> -----------------------------------------------
>          Key: STR-1569
>          URL:
>      Project: Struts Action 1
>         Type: Improvement

>   Components: Action
>     Versions: 1.1 Final
>  Environment: Operating System: other
> Platform: Other
>     Reporter: Ryan Barker
>     Priority: Minor
>      Fix For: 1.2 Family

> Side Note: Version for this bug is 1.1 Final which is not currently added to the
> Version list
> Issue: Placing a FormFile (CommonsMultipartRequestHandler.CommonsFormFile for
> example) into the users session will throw an IllegalArgumentException when the
> session is serialized to disk or to a clustered machine on J2EE compliant
> webservers (Weblogic for example). Note that does implement
> Serializable.
> The issue manifests itself in wizard style applications where the file is first
> uploaded and then other web requests, such as creating a parse format, must be
> made before the file is manipulated and saved to a database. The natural
> implementation of this style of application would be to have a FormFile as one
> of the properties of the ActionForm, and save the form in the session. Since it
> is not serializable, the app server is allowed to throw an exception.
> Work around steps:
> 1) Use request scoped ActionForm for the file upload.
> 2) In the Action, write the FormFile to a temporary file created with
> File.createTempFile
> 3) Finally place the File in the session or a session scoped ActionForm
> Fix:
> Make FormFile implementations, and any other object that would be stored in an
> ActionForm implement the interface.
> Reference material from J2EE1.3 spec Section 6.5 on Servlet 2.3 requirements:
> A J2EE distributable web application may place only objects of the following
> types into a javax.servlet.http.HttpSession object using the setAttribute or
> putValue methods:
> •
> • javax.ejb.EJBObject
> • javax.ejb.EJBHome
> • javax.transaction.UserTransaction
> • a javax.naming.Context object for the java:comp/env context
> Web containers may throw an IllegalArgumentException if an object that is
> not one of the above types is passed to the setAttribute or putValue methods of
> an HttpSession object corresponding to a J2EE distributable session.
> Please feel free to contact me regarding this bug.
> Ryan Barker

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message