You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2010/09/24 09:30:33 UTC

[jira] Assigned: (WICKET-3078) FileUploadException is masked behind WicketRuntimeException and not handled by a Form

     [ https://issues.apache.org/jira/browse/WICKET-3078?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov reassigned WICKET-3078:
---------------------------------------

    Assignee: Martin Grigorov

> FileUploadException is masked behind WicketRuntimeException and not handled by a Form
> -------------------------------------------------------------------------------------
>
>                 Key: WICKET-3078
>                 URL: https://issues.apache.org/jira/browse/WICKET-3078
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket, wicket-extensions
>    Affects Versions: 1.5-M2.1
>         Environment: Widnows, Jetty 7
>            Reporter: Ivan Vasilev
>            Assignee: Martin Grigorov
>
> I have a org.apache.wicket.markup.html.form.Form fileUploadForm, which has:
>     fileUploadForm.setMultiPart(true);
>     fileUploadForm.setMaxSize(Bytes.kilobytes(150));
> When the form is submitted with a file larger than 150K the following methods are called:
>     fileUploadForm -> handleMultiPart -> ServletWebRequest.newMultipartWebRequest((Bytes maxsize) and inside it
> 		try
> 		{
> 			return new MultipartRequest(getHttpServletRequest(), getFilterPrefix(), maxsize);
> 		}
> 		catch (FileUploadException e)
> 		{
> 			throw new WicketRuntimeException(e);
> 		}
> When the file size exceeds the maximum allowed a FileUploadException is thrown, however it is immediately caught and "masked" in a WicketRuntimeException. Inside the handleMultiPart method of the Form there is a catch block for FileUploadException, but the original exception is no longer of type FileUploadException and in this case the form fails to handle it. The result is that instead of an error message informing the user of exceeded limit a wicket stack trace page is displayed. 
> I'm not sure if this is part of wicket or wicket-extensions, because it involves classes from the both modules.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.