Bug 928002

Summary: Seam2.3 pages rewrite doesn't rewrite s:link params
Product: [Retired] JBoss Enterprise WFK Platform 2 Reporter: Marek Schmidt <maschmid>
Component: SeamAssignee: Marek Novotny <mnovotny>
Status: CLOSED CURRENTRELEASE QA Contact: Marek Schmidt <maschmid>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 2.2.0CC: ppenicka, snagarwa, tremes
Target Milestone: ER1   
Target Release: 2.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Using the <rewrite> configuration in Seam's components.xml file did not ensure correct URL rewriting. As URL rewriting was performed before parameters are set, URLs produced by the <s:link> and <s:button> elements were rendered with query string parameters. This has been fixed by rewriting the ViewUrlBuilder to use ViewHandler API appropriately with respect to bookmarkable URLs.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-16 11:33:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marek Schmidt 2013-03-26 16:32:04 UTC
Description of problem:

Having this in the pages.xml:

<page view-id="/entry.xhtml"> 
        <rewrite pattern="/entry/{blogEntryId}" />
        <rewrite pattern="/entry" />
        
        <param name="blogEntryId" 
               value="#{blogEntry.id}"/>
        
        <action execute="#{entryAction.loadBlogEntry(blogEntry.id)}"/>
    </page>

and a link to entry in a page:

<s:link id="link" view="/entry.xhtml" propagation="none" value="#{blogEntry.title}">
   <f:param name="blogEntryId" value="#{blogEntry.id}"/>
</s:link>

this should render as a link to "/entry/foo", but it renders as "/entry?blogEntryId=roadmap11"

Version-Release number of selected component (if applicable):
WFK 2.2.0.CR1 

How reproducible:
Always

Steps to Reproduce:
1. build and deploy the seam-blog example
2. Go to http://127.0.0.1:8080/seam-blog/
3. Notice the URL in [Link] link in the Seam Text article.
  
Actual results:
http://127.0.0.1:8080/seam-blog/entry?blogEntryId=seamtext

Expected results:
http://127.0.0.1:8080/seam-blog/entry/seamtext

Comment 1 Marek Schmidt 2013-03-26 18:02:47 UTC
Interesting observation: removing the '<rewrite pattern="/entry" />' rule makes the other rule work.

Comment 4 Marek Novotny 2013-04-04 06:25:53 UTC
This issue goes away with reverted patch for https://bugzilla.redhat.com/show_bug.cgi?id=921660

Comment 5 Marek Novotny 2013-04-04 06:28:04 UTC
My previous comment was a mistake, it doesn't work.

Comment 6 Petr Penicka 2013-04-17 22:39:10 UTC
Edited release note and inserted it into the 2.2.0 RN book.

Docs stage URL: https://documentation-devel.engineering.redhat.com/docs/en-US/JBoss_Web_Framework_Kit/2.2/html-single/2.2.0_Release_Notes/index.html

Build: JBoss_Web_Framework_Kit-2.2.0_Release_Notes-2.2-en-US-0-23

Comment 7 JBoss JIRA Server 2013-05-17 12:49:05 UTC
Marek Novotny <mnovotny> made a comment on jira JBSEAM-5085

I figured out how to change the incorrect behavior of org.jboss.seam.ui.util.ViewUrlBuilder. The existence of viewHandler.getBookmarkableUrl was premature to call in ViewUrlBuilder initialization, because we need added parameters in URL. So after discussion with Marek Schmidt I prepared the change. However that change broke the calling of page actions due double url encoding - experienced in org.jboss.seam.test.integration.faces.conversations.ConversationPropagationsTest.testSButtonActionPropagationNone(). So I changed default url encoding to false in org.jboss.seam.ui.util.ViewUrlBuilder.ViewUrlBuilder(String, String).

The test case for Page rewrite is added as org.jboss.seam.test.integration.faces.ViewUrlBuilderTest.

Comment 8 JBoss JIRA Server 2013-05-17 12:50:09 UTC
Marek Novotny <mnovotny> made a comment on jira JBSEAM-5085

I figured out how to change the incorrect behavior of {{org.jboss.seam.ui.util.ViewUrlBuilder}}. The existence of {{viewHandler.getBookmarkableUrl}} was premature to call in {{ViewUrlBuilder}} initialization, because we need added parameters in URL. So after discussion with Marek Schmidt I prepared the change. However that change broke the calling of page actions due double url encoding - experienced in {{org.jboss.seam.test.integration.faces.conversations.ConversationPropagationsTest.testSButtonActionPropagationNone()}}. So I changed default url encoding to false in {{org.jboss.seam.ui.util.ViewUrlBuilder.ViewUrlBuilder(String, String)}}.

The test case for Page rewrite is added as {{org.jboss.seam.test.integration.faces.ViewUrlBuilderTest}}.

Comment 9 JBoss JIRA Server 2013-05-17 12:52:10 UTC
Marek Novotny <mnovotny> updated the status of jira JBSEAM-5085 to Resolved

Comment 10 Marek Novotny 2013-06-03 13:41:09 UTC
back ported the fix as https://source.jboss.org/changelog/Seam?cs=15510 and

Comment 12 JBoss JIRA Server 2013-06-07 13:55:04 UTC
Marek Novotny <mnovotny> updated the status of jira JBSEAM-5085 to Closed

Comment 13 JBoss JIRA Server 2013-06-07 13:55:04 UTC
Marek Novotny <mnovotny> made a comment on jira JBSEAM-5085

2.3.1.CR1 is now out, so closing all resolved issues

Comment 14 Tomas Remes 2013-06-13 07:58:11 UTC
Verified on 2.3.0.ER1 release.

Comment 15 Sneha 2013-07-03 09:48:04 UTC
Updated doc text.