You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leif Hanack (JIRA)" <de...@myfaces.apache.org> on 2007/02/28 14:31:57 UTC
[jira] Created: (MYFACES-1547) ServletExternalContextImpl.redirect
did not encode URL, so URL-rewriting fail
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
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.
[jira] Updated: (MYFACES-1547) ServletExternalContextImpl.redirect
did not encode URL, so URL-rewriting fail
Posted by "Leif Hanack (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-1547?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Leif Hanack updated MYFACES-1547:
---------------------------------
Status: Patch Available (was: Open)
> 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
>
> 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.
[jira] Commented: (MYFACES-1547)
ServletExternalContextImpl.redirect did not encode URL, so URL-rewriting
fail
Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
[ 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.
[jira] Commented: (MYFACES-1547)
ServletExternalContextImpl.redirect did not encode URL, so URL-rewriting
fail
Posted by "Leif Hanack (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-1547?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12476585 ]
Leif Hanack commented on MYFACES-1547:
--------------------------------------
sorry, was in a hurry and this is my first experience with jira bug report:)
> 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
> 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.
[jira] Updated: (MYFACES-1547) ServletExternalContextImpl.redirect
did not encode URL, so URL-rewriting fail
Posted by "Matthias Weßendorf (JIRA)" <de...@myfaces.apache.org>.
[ https://issues.apache.org/jira/browse/MYFACES-1547?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Matthias Weßendorf updated MYFACES-1547:
----------------------------------------
Resolution: Won't Fix
Status: Resolved (was: Patch Available)
client of this API should do it
> 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
> 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.