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

Vjacheslav Kanivetc commented on WICKET-2738:
---------------------------------------------

No, this is the same problem, to reproduce:

1. mount 2 pages like:
mount(new BookmarkablePageRequestTargetUrlCodingStrategy("mail", 
MailPage.class, null));

2. navigate to MailPage with PageParameters having "folder" -> "inbox" 
(key/value pair), url will be correct : http://localhost:8080/mail/folder/inbox/

3. add a link to this page,
PageParameters params = new PageParameters();
params.put("folder", "new");
add(new BookmarkablePageLink<MailPage>("newMessage", MailPage.class, params)));

4. click on it, you will get error report from tomcat and url in the browser 
will be http://localhost:8080/mail/folder/inbox/mail/folder/new
The correct url in the browser (and it was so in wicket 1.4.5 and below) would 
be http://localhost:8080/mail/folder/new

So the problem is that no leading / (context path) is set to the links so the 
leads to incorrect urls.

PS: I am quite sure that the causes of many exceptions in the console like:
java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to 
java.lang.String
        at 
org.apache.wicket.request.target.coding.BookmarkablePageRequestTargetUrlCodingStrategy.decode(BookmarkablePageRequestTargetUrlCodingStrategy.java:91)
        at 
org.apache.wicket.protocol.http.request.WebRequestCodingStrategy.targetForRequest(WebRequestCodingStrategy.java:515)
        at 
org.apache.wicket.protocol.http.WebRequestCycleProcessor.resolve(WebRequestCycleProcessor.java:191)
        at org.apache.wicket.RequestCycle.step(RequestCycle.java:1310)
        at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1428)
        at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)


> setResponsePage doesn't work with MixedParamUrlCodingStrategy
> -------------------------------------------------------------
>
>                 Key: WICKET-2738
>                 URL: https://issues.apache.org/jira/browse/WICKET-2738
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.4.6
>         Environment: Wicket 1.4.6 only
>            Reporter: Denis Souza
>             Fix For: 1.4.7
>
>
> When I call setResponsePage() on a page that uses MixedParamUrlCodingStrategy 
> the URL for the destination page is mixed with the URL from the current page.
> In my case, take the URL for a product such as:
> /app/product/1402
> when the user clicks the "Buy" button it adds the product to the shopping 
> cart and calls:
> setResponsePage(ShoppingCartPage.class)
> resulting in a redirect to:
> /app/product/checkout/shoppingcart
> when it should be:
> /app/checkout/shoppingcart
> Works fine in wicket 1.4.5

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

Reply via email to