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

Martin Grigorov commented on WICKET-6208:
-----------------------------------------

The problem is in Atmosphere (I play surprised here!).

1) Wicket tries to read the 'Wicket-Ajax-baseUrl' from the request headers: 
https://github.com/apache/wicket/blob/4216e09a4cf23179cf9de3a23b1ad989caf7da91/wicket-core/src/main/java/org/apache/wicket/protocol/http/servlet/ServletWebRequest.java#L151

2) Atmosphere first checks for this header in the servlet http request (so far 
so good!)
3) If there is no such header then Atmosphere tries to find this header in the 
request parameters (Why Atmosphere?! Why?!)
https://github.com/Atmosphere/atmosphere/blob/cd813ef1a641f621410ff47795d9d954694b4e65/modules/cpr/src/main/java/org/atmosphere/cpr/AtmosphereRequestImpl.java#L349-L352
4) Atmosphere finds a value and returns it

The problems are:
1) Why "b.headers" contains request *parameters* too ?
2) If those parameters must be in "b.header" for some really important reason 
then their values should be URL decoded when read


I have seen so much weird code in Atmosphere...
The problem is that the newer versions of Atmosphere (2.4.x) have major API 
breaks compared to 2.2.x and I personally found 3 bugs while trying to upgrade 
Wicket-Atmosphere several months ago. I don't have energy to keep fighting with 
it!

> setMultiPart causes Not Found-Error when performing AjaxRefresh on Form
> -----------------------------------------------------------------------
>
>                 Key: WICKET-6208
>                 URL: https://issues.apache.org/jira/browse/WICKET-6208
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket, wicket-atmosphere
>    Affects Versions: 7.3.0
>            Reporter: Johannes Esseling
>            Assignee: Emond Papegaaij
>         Attachments: quickstart-multipart-form.zip
>
>
> Hello,
> I am trying to migrate to Wicket 7 and also use Wicket-Atmosphere. 
> Everything seemed to work fine until I encountered a Form where I enabled 
> "setMultiPart". 
> I have a few FormComponents and a few Uploads in that form. The form also 
> contains an AjaxSubmitLink. I do this to refresh all potential FeedBackPanels 
> in that form.
> {code}
>  @Override
>             protected void onError(AjaxRequestTarget target, Form<?> form) {
>                 target.add(form);
>             }
> {code}
> Now to the problem:
> I have mapped the Page containing the form in my quickstart to 
> "/home/staying/disappearing".
> When I submit the form without entering something in a FormComponent in the 
> Form the "onError" gets called and the form refreshed via Ajax. 
> I noticed something strange in the Header-Contribution of the Ajax-Response: 
> {code}
> <header-contribution><![CDATA[<head 
> xmlns:wicket="http://wicket.apache.org";><script type="text/javascript" 
> src="./wicket/resource/org.apache.wicket.resource.JQueryResourceReference/jquery/jquery-1.12.3-ver-1468849186000.js"></script>
> ...
> </head>]]></header-contribution>
> {code}
> Shouldn't the path to the resource be "../../wicket/resource/....."? 
> Following the AjaxResponse is the evaluation of the resources:
> {code}
> GET 
> http://localhost:8080/home/staying/wicket/resource/org.apache.wicket.resource.JQueryResourceReference/jquery/jquery-1.12.3-ver-1468849186000.js
>  
> {code}
> This causes the Not Found - Error. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to