Bug 794309 (JBEPP-1358) - Resource generated by renderResponse.createResourceURL() is escaped when used in script
Summary: Resource generated by renderResponse.createResourceURL() is escaped when used...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: JBEPP-1358
Product: JBoss Enterprise Portal Platform 5
Classification: JBoss
Component: unspecified
Version: 5.2.0.ER06
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 5.2.0.CR01
Assignee: Matt Wringe
QA Contact:
URL: http://jira.jboss.org/jira/browse/JBE...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-11 15:41 UTC by Michal Vanco
Modified: 2013-04-30 23:35 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
EPP5.2.0 ER06
Last Closed: 2011-11-13 21:35:47 UTC
Type: Bug


Attachments (Terms of Use)
resource-5.1.0-GA.png (125.74 KB, image/png)
2011-11-11 15:42 UTC, Michal Vanco
no flags Details
resource-5.2.0-ER06.png (83.28 KB, image/png)
2011-11-11 15:42 UTC, Michal Vanco
no flags Details
resource-sample-1.0.0-SNAPSHOT.war (57.46 KB, application/x-extension-war)
2011-11-11 15:42 UTC, Michal Vanco
no flags Details
resource-GateIn-trunk-11-11-11.png (111.62 KB, image/png)
2011-11-11 16:16 UTC, Michal Vanco
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBEPP-1358 0 None None None Never

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



Note You need to log in before you can comment on or make changes to this bug.