Bug 794309 (JBEPP-1358)

Summary: Resource generated by renderResponse.createResourceURL() is escaped when used in script
Product: [JBoss] JBoss Enterprise Portal Platform 5 Reporter: Michal Vanco <mvanco>
Component: unspecifiedAssignee: Matt Wringe <mwringe>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 5.2.0.ER06CC: epp-bugs, mvanco, mvecera
Target Milestone: ---Keywords: Regression
Target Release: 5.2.0.CR01   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/JBEPP-1358
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
EPP5.2.0 ER06
Last Closed: 2011-11-13 21:35:47 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:
Attachments:
Description Flags
resource-5.1.0-GA.png
none
resource-5.2.0-ER06.png
none
resource-sample-1.0.0-SNAPSHOT.war
none
resource-GateIn-trunk-11-11-11.png none

Description Michal Vanco 2011-11-11 15:41:39 UTC
Steps to Reproduce: Use attached portlet
project_key: JBEPP

There a scenario with resource which used to work at 5.1.0 GA.

Resource is created by 
ResourceURL resource2 = renderResponse.createResourceURL();
and then used in script element, for example:
document.getElementById('mylink').href='<%= resource2 %>';

Resource generated this way contains extra amp; after & and it causes that serveResource method isn't called at all because invalid request.

Result in combination with JS/ajax can be that whole portal page is included as resource instead of requested content.

Attached portlet reproduce the issue (works well on 5.1.0 GA, fails on 5.2.0)

Btw. there is also option that doesn't work at both 5.1.0 and 5.2.0 -> resource created by portlet:resourceURL var="res" and then used with ${res} at some script element (extra amp; is added as well) - this is second scenario at portlet.

Feel free to ask if there is anything unclear

Comment 1 Michal Vanco 2011-11-11 15:42:31 UTC
Attachment: Added: resource-5.1.0-GA.png
Attachment: Added: resource-5.2.0-ER06.png
Attachment: Added: resource-sample-1.0.0-SNAPSHOT.war


Comment 2 Michal Vanco 2011-11-11 15:47:52 UTC
Link: Added: This issue is related to JBQA-5503


Comment 3 Michal Vanco 2011-11-11 16:12:43 UTC
I've tried with GateIn trunk now and all examples worked properly, below URLs were generated in sample portlet:

/portal/classic/sitemap?portal:componentId=7ee612af-03d8-4cca-81e5-c858fb8dbe28&portal:windowState=normal&portal:cacheLevel=PAGE&portal:type=resource&portal:portletMode=view&portal:isSecure=false

/portal/classic/sitemap?portal:componentId=7ee612af-03d8-4cca-81e5-c858fb8dbe28&amp;portal:windowState=normal&amp;portal:cacheLevel=PAGE&amp;portal:type=resource&amp;portal:portletMode=view&amp;portal:isSecure=false

/portal/classic/sitemap?portal:componentId=7ee612af-03d8-4cca-81e5-c858fb8dbe28&amp;portal:windowState=normal&amp;portal:resourceID=resourceAjax&amp;portal:cacheLevel=PAGE&amp;portal:type=resource&amp;portal:portletMode=view

It says that URL with extra amp; was handled properly as resource.
So this seems to be problem only in EPP.

Comment 4 Michal Vanco 2011-11-11 16:16:06 UTC
Attached screen from gatein trunk (11-11-11), all 3 samples works.

Comment 5 Michal Vanco 2011-11-11 16:16:06 UTC
Attachment: Added: resource-GateIn-trunk-11-11-11.png


Comment 8 Jared MORGAN 2011-11-13 21:35:47 UTC
Release Notes Docs Status: Added: Not Required