You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Petr Nejedlík (JIRA)" <ji...@apache.org> on 2012/09/04 02:11:07 UTC

[jira] [Commented] (WICKET-4715) WebApplication doesn't recognize if an incoming request is multipart.

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

Petr Nejedlík commented on WICKET-4715:
---------------------------------------

We have upgraded from wicket 1.5.7 to 1.5.8 and I must say that changes in WebApplication in method createWebRequest (where in multipart case method newMultipartWebRequest is called) are bad for us.
We have maxSizeLimit defined in every UploadPanel (component that upload files) not in application.
In this situation, there is even no chance to declare maxSize on Form component. You can declare it by setMaxSize, but when Form calls method newMultipartWebRequest this defined size is not used because MultipartServletWebRequestImpl class has been already created in createWebRequest in method createWebRequest in WebApplicationClass.

I tried to inherit from WebApplication, overiide method newWebRequest a then in own descendant of ServletWebRequest owerride method newMultipartWebRequest.
But there is problem - method newMultipartWebRequest must return MultipartServletWebRequest (abstract class) not WebRequest.

Is it possible to change method newMultipartWebRequest to return only WebRequest.
In that situation we can override method newMultipartWebRequest, return self (descendant of ServletWebRequest) and create MultipartServletWebRequestImpl later (in onRespond method)

Thanks Petr Nejedlik
                
> WebApplication doesn't recognize if an incoming request is multipart.
> ---------------------------------------------------------------------
>
>                 Key: WICKET-4715
>                 URL: https://issues.apache.org/jira/browse/WICKET-4715
>             Project: Wicket
>          Issue Type: Bug
>    Affects Versions: 1.5.7, 6.0.0-beta3
>            Reporter: Andrea Del Bene
>            Assignee: Martin Grigorov
>             Fix For: 1.5.8, 6.0.0
>
>         Attachments: WICKET-4715.patch
>
>
> Thanks to the mail at http://apache-wicket.1842946.n4.nabble.com/Read-POST-based-request-from-external-site-td4651269.html we have spotted a problem with method  newWebRequest of class WebApplication. 
> It seems that this method doesn't test if the original request is multipart and doing so post parameters go lost. 
> We should create a  MultipartServletWebRequestImpl when such a type of request is being served. I attach a possible patch but I'm not 100% about two things:
> - which is the best way to determinate if a HttpServletRequest is multipart?
> - in order to build a MultipartServletWebRequestImpl we need to provide a string identifier for the upload.   How can we generate it (in my patch it's a constant value)?

--
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