From jira-events at lists.jboss.org Mon Mar 19 08:56:47 2012
Content-Type: multipart/mixed; boundary="===============2765915041111538064=="
MIME-Version: 1.0
From: =?utf-8?q?Marko_Luk=C5=A1a_=28JIRA=29_=3Cjira-events_at_lists=2Ejboss=2Eo?=
=?utf-8?q?rg=3E?=
To: weld-issues at lists.jboss.org
Subject: [weld-issues] [JBoss JIRA] (WELD-909) Dual faces mapping and cid
parameter for conversational redirect
Date: Mon, 19 Mar 2012 08:56:47 -0400
Message-ID: <1563315313.17086.1332161807525.JavaMail.tomcat@jira02.app.mwc.hst.phx2.redhat.com>
In-Reply-To: 919417920.18945.1306165020903.JavaMail.tomcat@jira02.app.mwc.hst.phx2.redhat.com
--===============2765915041111538064==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
[ https://issues.jboss.org/browse/WELD-909?page=3Dcom.atlassian.jira.p=
lugin.system.issuetabpanels:all-tabpanel ]
Marko Luk=C5=A1a updated WELD-909:
-----------------------------
Git Pull Request: https://github.com/weld/core/pull/183
Fixed.
The problem was in FacesUrlTransformer.toActionUrl(), where the original ur=
l already contained the cid parameter. As a result, {{queryParameters}} als=
o contained the parameter. Furthermore, {{actionUrl}} (obtained by calling =
{{getActionURL()}}) also contained the cid parameter. Since {{actionUrl}} a=
nd {{queryParameters}} are simply concatenated, the resulting url will cont=
ain the dual cid parameters.
I should probably have parsed both query strings and merged them parameter-=
by-parameter, but this would be overkill and could have possibly introduced=
new bugs (because of the parsing and then rebuilding the query string). I =
opted for a simpler solution, since {{actionUrl}} will only contain the cid=
parameter (and no other parameters) in all but the most exotic cases. So i=
f {{actionUrl}}'s query string is fully contained in {{queryParameters}}, I=
simply ignore it and use {{queryParameters}} instead. =
=
> Dual faces mapping and cid parameter for conversational redirect
> ----------------------------------------------------------------
>
> Key: WELD-909
> URL: https://issues.jboss.org/browse/WELD-909
> Project: Weld
> Issue Type: Bug
> Components: Conversations
> Affects Versions: 1.1.1.Final
> Reporter: Nicklas Karlsson
> Assignee: Marko Luk=C5=A1a
>
> Given a page like
> {code}
>
>
> xmlns:ui=3D"http://java.sun.com/jsf/facelets"
> xmlns:h=3D"http://java.sun.com/jsf/html"
> xmlns:f=3D"http://java.sun.com/jsf/core">
>
>
> Concept
>
>
>
>
>
>
>
>
>
>
> {code}
> and a backing bean like
> {code}
> package fi.nik.concept;
> import javax.enterprise.context.Conversation;
> import javax.inject.Inject;
> import javax.inject.Named;
> @Named
> public class BackingBean =
> {
> @Inject
> private Conversation conversation;
> public String nonTransient() =
> {
> conversation.begin();
> return "page?faces-redirect=3Dtrue";
> }
> }
> {code}
> clicking "redirect" with non-transient conversations work fine but clicki=
ng "non-transient" duplicates the faces mappings and cid to something like =
http://localhost:8080/concept/faces/faces/page.xhtml?cid=3D1&cid=3D1 and cl=
icking "redirect" after keeps the URL like that.
> It works normally after that (since the faces mapping is still hit and th=
e cid is repeated with the same value) but it looks a bit odd.
> Would have written a test for it but git on Windows is... a bit nonlinear=
at times.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrato=
rs: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
=
--===============2765915041111538064==--