You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Juergen Donnerstag (JIRA)" <ji...@apache.org> on 2009/01/17 22:52:59 UTC
[jira] Commented: (WICKET-2007) redirect with umlauts fails
[ https://issues.apache.org/jira/browse/WICKET-2007?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12664868#action_12664868 ]
Juergen Donnerstag commented on WICKET-2007:
--------------------------------------------
wicket 1.4 trunk seems to do the encoding
@Override
public void redirect(String url)
{
if (!redirect)
{
if (httpServletResponse != null)
{
// encode to make sure no caller forgot this
>>> HERE url = httpServletResponse.encodeRedirectURL(url);
...
else
{
httpServletResponse.sendRedirect(url);
}
Could you please provide a quickstart or testcase with an example that is not working. Thanks.
> redirect with umlauts fails
> ---------------------------
>
> Key: WICKET-2007
> URL: https://issues.apache.org/jira/browse/WICKET-2007
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.3.5, 1.4-RC1
> Reporter: Sven Meier
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> When Wicket sends a redirect, it doesn't encode the URL of the "Location:" header - it just writes it out as it is.
> Because a redirect does not contain encoding information, the browser cannot correctly decode containing umlauts.
> Setting a contentType seems not to be relavant in a response with HTTP status 3xx , both IE and Firefox seem to disregard it.
> Thus I propose, that WebResponse#redirect(String) should always encode the given URL according to IRequestCycle#responseRequestEncoding or perhaps fixed to "UTF-8".
> I'm currently using a subclass of WebResponse which utiilizes a tweaked WicketURLEncoder to encode all umlauts:
> public void redirect(String url) {
> url = redirectEncoder.encode(url);
> super.redirect(url);
> }
> // don't encode any delimiter
> private static final WicketURLEncoder redirectEncoder = new WicketURLEncoder(-1) {
> {
> dontNeedEncoding.set(' ');
> dontNeedEncoding.set('/');
> dontNeedEncoding.set('?');
> dontNeedEncoding.set('&');
> dontNeedEncoding.set('=');
> dontNeedEncoding.set('+');
> dontNeedEncoding.set(';');
> }
> };
> Note that specifying the URIEncoding on the Tomcat connector (as required for Ajax requests) does *not* solve the problem.
> (http://wiki.apache.org/tomcat/FAQ/Connectors#Q8)
> (http://cwiki.apache.org/WW/how-to-support-utf-8-uriencoding-with-tomcat.html)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.