You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by "Don Brown (JIRA)" <ji...@apache.org> on 2006/04/25 21:24:45 UTC

[jira] Closed: (STR-1569) FormFile implementations should be serializable

     [ http://issues.apache.org/struts/browse/STR-1569?page=all ]
     
Don Brown closed STR-1569:
--------------------------

    Resolution: Fixed

> FormFile implementations should be serializable
> -----------------------------------------------
>
>          Key: STR-1569
>          URL: http://issues.apache.org/struts/browse/STR-1569
>      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 java.io.File 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 java.io.Serializable 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:
> • java.io.Serializable
> • 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:
   http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org