You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Andrea Del Bene (JIRA)" <ji...@apache.org> on 2012/08/16 17:03:38 UTC

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

Andrea Del Bene created WICKET-4715:
---------------------------------------

             Summary: 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: 6.0.0-beta3, 1.5.7
            Reporter: Andrea Del Bene


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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4715?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-4715.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 6.0.0
                   1.5.8
    
> 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Posted by "Andrea Del Bene (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4715?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrea Del Bene updated WICKET-4715:
------------------------------------

    Attachment: WICKET-4715.patch
    
> 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
>         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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Posted by "Sergey B (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13450453#comment-13450453 ] 

Sergey B commented on WICKET-4715:
----------------------------------

I also have some strange related problems with multipart:
we have several jsp pages which doesn't have anything to do with wicket. But they use multipart upload forms served by Apache ServletFileUpload.
When we make single change in our project - upgrade wicket version from 1.5.7 to 1.5.8 (in pom) this forms becomes broken:
line 
List<FileItem> items = upload.parseRequest(request);
always returns zero items with wicket 1.5.8 in project.
I can't even imagine how change of wicket  can affect some JSPs...
Example:

<%@ page import="org.apache.commons.fileupload.FileItem" %>
<%@ page import="org.apache.commons.fileupload.disk.DiskFileItemFactory" %>
<%@ page import="org.apache.commons.fileupload.servlet.ServletFileUpload" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" session="false" %>

<form action="<%=request.getRequestURI()%>" method="post" enctype="multipart/form-data">
    <input type="file" name="file" size="120"/>
    <input type="submit" value="Upload"/>
</form>

<%
        final int maxSize = 16 * 1024 * 1024;
        DiskFileItemFactory factory = new DiskFileItemFactory();
        factory.setSizeThreshold(maxSize);

        ServletFileUpload upload = new ServletFileUpload(factory);
        upload.setSizeMax(maxSize);
        List items = upload.parseRequest(request); //This always returns empty list in 1.5.8
%>
                
> 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

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

Posted by "Andrea Del Bene (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4715?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrea Del Bene updated WICKET-4715:
------------------------------------

    Attachment:     (was: WICKET-4715.patch)
    
> 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
>         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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4715?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-4715.
-------------------------------------

    Resolution: Fixed

I'm closing this ticket.
The change will be most probably reverted with WICKET-4752 unless someone finds a solution that will work for all cases.
                
> 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: 6.0.0, 1.5.8
>
>         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

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

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13437697#comment-13437697 ] 

Martin Grigorov commented on WICKET-4715:
-----------------------------------------

False alarm. Seems to work fine.
                
> 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
>         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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13437684#comment-13437684 ] 

Martin Grigorov commented on WICKET-4715:
-----------------------------------------

I think this patch will break normal form submit with multipart content in org.apache.wicket.markup.html.form.Form#handleMultiPart(), but let me check it.
                
> 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
>         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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Posted by "Andrea Del Bene (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4715?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrea Del Bene updated WICKET-4715:
------------------------------------

    Attachment: WICKET-4715.patch
    
> 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
>         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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13450458#comment-13450458 ] 

Martin Grigorov commented on WICKET-4715:
-----------------------------------------

The problem is that WicketFilter is executed before the JspServlet and thus the POST request parameters are already consumed.

The previous fix that I've added for 1.5.9 wont help for this new case.
I think we should revert the change completely. To support the original use case for this ticket the user application should create the MultipartWebRequest itself in the page constructor to be able to read the file upload parameters. I see no other way :-/
                
> 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

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

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4715?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov reassigned WICKET-4715:
---------------------------------------

    Assignee: Martin Grigorov
    
> 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
>         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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13447546#comment-13447546 ] 

Martin Grigorov commented on WICKET-4715:
-----------------------------------------

Hi Petr,

I've just committed an improvement for this regression.
Can you test with latest 1.5-SNAPSHOT ? Or attach a quickstart so we can test it.
Thanks!
                
> 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

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

Posted by "Andrea Del Bene (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13436247#comment-13436247 ] 

Andrea Del Bene commented on WICKET-4715:
-----------------------------------------

I've seen how Commons FileUpload library solved the problem of determining if a HttpServletRequest is multipart and is quite similar to what I've done, so now I'm confident with my code :).
I've improved my patch adding a test case for multipart requests.
                
> 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
>         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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4715?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13466703#comment-13466703 ] 

Martin Grigorov commented on WICKET-4715:
-----------------------------------------

The change has been reverted for Wicket 1.5.9 and 6.2.0.
                
> 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

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

Posted by "Petr Nejedlík (JIRA)" <ji...@apache.org>.
    [ 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

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

Posted by "Martin Grigorov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4715?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov reopened WICKET-4715:
-------------------------------------

    
> 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