You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Christian Köberl (JIRA)" <ji...@apache.org> on 2013/06/28 09:35:19 UTC

[jira] [Commented] (TAP5-2136) Page with Upload component loses context on FileUploadException

    [ https://issues.apache.org/jira/browse/TAP5-2136?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13695304#comment-13695304 ] 

Christian Köberl commented on TAP5-2136:
----------------------------------------

The actual problem lies in commons-fileupload: the FileUploadException occurs in ServletFileUpload#parseRequest, so no List<FileItem> is returned. The "normal" form parameters would be in that list - no list, no parameters. So, Tapestry has no form parameters whatsoever. That's why everything is lost.

I tried to think of a solution without success. Anyone an idea how to solve this?
                
> Page with Upload component loses context on FileUploadException
> ---------------------------------------------------------------
>
>                 Key: TAP5-2136
>                 URL: https://issues.apache.org/jira/browse/TAP5-2136
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-upload
>    Affects Versions: 5.3.7, 5.2.6
>            Reporter: Christian Köberl
>
> Given a page with activation context
> And an Upload component on that page
> And an FileUploadException occurs on submit
> Then the page loses the activation context.
> UploadTest.tml:
> <div t:type="layout">
> <form t:type="form">
>   <label>Upload File <input type="file" t:type="upload"
> value="uploadedFile"></input></label>
>   <input type="submit" t:type="submit" value="Submit" />
> </form>
> </div>
> UploadTest.java:
> public class UploadTest
> {
>     @PageActivationContext
>     @Property
>     private String contextValue;
>     @Property
>     private UploadedFile uploadedFile;
>     @OnEvent("UploadException")
>     UploadTest handleException(FileUploadException ex)
>     {
>         return this;
>     }
> }
> Demo project to see this problem in action:
> https://github.com/derkoe/tapestry-upload-test

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira