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

Sven Meier updated WICKET-2061:
-------------------------------

    Attachment: encodingtest.zip

The promised example.

Note that the problem occurs only, if the umlauts are part of the request path.

> interceptContinuationURL with umlauts not encoded
> -------------------------------------------------
>
>                 Key: WICKET-2061
>                 URL: https://issues.apache.org/jira/browse/WICKET-2061
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.5, 1.3.6, 1.4-RC1
>            Reporter: Sven Meier
>         Attachments: encodingtest.zip
>
>
> This is my second try to fix Wicket's encoding of redirects to intercepted 
> URLs.
> Instead of reopening WICKET-2007, I decided to create this new issue and make 
> a clean start.
> When Wicket redirects to an intercept page, it stores the original URL in 
> PageMap#interceptContinuationURL.
>               // The intercept continuation URL should be saved exactly as the
>               // original request specified.
>               ...
>                       interceptContinuationURL = "/" + 
> cycle.getRequest().getURL();
> Note that comment and code are not in sync:
> Instead of saving *exactly* the original request, a new URL is generated. 
> ServletWebRequest#getURL() does *not* encode special characters. Thus on a 
> later continuation, the redirect to the original URL fails in case of special 
> characters (umlauts in our case).
> The following patch would save *almost* the original request (it has to 
> remove the context path because RedirectRequestTarget prepends it later on).
> I cannot say if this solution has unwanted side effects though:
> Index: src/main/java/org/apache/wicket/PageMap.java
> ===================================================================
> RCS file: /boss/dev/src/main/java/org/apache/wicket/PageMap.java,v
> retrieving revision 1.1
> diff -u -r1.1 PageMap.java
> --- src/main/java/org/apache/wicket/PageMap.java      30 Jan 2009 12:54:41 
> -0000      1.1
> +++ src/main/java/org/apache/wicket/PageMap.java      30 Jan 2009 12:55:02 
> -0000
> @@ -262,7 +262,10 @@
>               }
>               else
>               {
> -                     interceptContinuationURL = "/" + 
> cycle.getRequest().getURL();
> +                     WebRequest request = (WebRequest) cycle.getRequest();
> +                     String uri = 
> request.getHttpServletRequest().getRequestURI();
> +                     String contextPath = 
> request.getHttpServletRequest().getContextPath();
> +                     interceptContinuationURL = 
> uri.substring(contextPath.length());
>               }
>  
> Note that the encoding done in WebResponse#redirect(String) appends a session 
> id only, it doesn't handle special characters (e.g. umlauts).

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