You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org> on 2007/02/28 14:37:57 UTC

[jira] Commented: (MYFACES-1547) ServletExternalContextImpl.redirect did not encode URL, so URL-rewriting fail

    [ https://issues.apache.org/jira/browse/MYFACES-1547?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12476583 ] 

Matthias Weßendorf commented on MYFACES-1547:
---------------------------------------------

please don't add complete files.
use patches instead.

thx

> ServletExternalContextImpl.redirect did not encode URL, so URL-rewriting fail
> -----------------------------------------------------------------------------
>
>                 Key: MYFACES-1547
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1547
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: General
>    Affects Versions: 1.1.5
>            Reporter: Leif Hanack
>         Assigned To: Matthias Weßendorf
>         Attachments: ServletExternalContextImpl.java
>
>
> I'm using Spring WebFlow (SWF) in combination with MyFaces/Trinidad. I have the problem that the FlowPhaseListener from SWF is calling a method that triggers ServletExternalContextImpl.redirect be to called.
>  
> ServletExternalContextImpl.java
> 489    public void redirect(String url) throws IOException
> 490    {
> 491        if (_servletResponse instanceof HttpServletResponse)
> 492        {
> 493          ((HttpServletResponse)_servletResponse).sendRedirect(url);
> 494           FacesContext.getCurrentInstance().responseComplete();            
> 495        }
> 496        else
> 497        {
> 498            throw new IllegalArgumentException("Only HttpServletResponse supported");
> 499        }
> 500    }
> The redirect method is calling a sendRedirect on the response but did not encode the url, so in case of URL-rewriting the jsessionid is not attached!
> This patch would solve my problem:
>  
> replace line 493 with the following two lines:
> String encodedUrl = ((HttpServletResponse)_servletResponse).encodeURL(url);
> ((HttpServletResponse)_servletResponse).sendRedirect(encodedUrl);
>  
> Thanks in advance, Leif

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