I encountered a Problem with the "Upload" component since switching to
Tapestry 5.3 - the page activation context is lost, when the file size
exceeds UploadSymbols.FILESIZE_MAX.

The setup is quite simple -  a page with a @PageActivationContext
property and a form with an Upload component in it.

The page is opened with a context. When you upload a file with a size
greater than the symbol "upload.filesize-max" then the UploadException
event is triggered - this is caught in the page and the page itself is
returned. After that the context is lost.

I also tried to return a PageLink with context from the
UploadException event handler with the same result.

Is this a bug or am I doing something wrong here?

Full code under:
https://github.com/derkoe/tapestry-upload-test

Relevant snippets here:
TML:
<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>

Java:
public class UploadTest
{
    @PageActivationContext
    @Property
    private String contextValue;

    @Property
    private UploadedFile uploadedFile;

    @OnEvent("UploadException")
    UploadTest handleException(FileUploadException ex)
    {
        return this;
    }
}

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to