Bug 981746 - escapeXml feature is ignored and the url is not encoded in wsrp.
Summary: escapeXml feature is ignored and the url is not encoded in wsrp.
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: JBoss Enterprise Portal Platform 5
Classification: JBoss
Component: Portal
Version: 5.1.1.GA
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: Thomas Heute
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-05 16:57 UTC by Gary Hu
Modified: 2018-12-02 16:27 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-09-26 07:50:26 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker GTNWSRP-368 0 Major Resolved escapeXml feature is ignored in wsrp. 2013-10-04 07:09:58 UTC

Comment 1 Gary Hu 2013-07-05 16:59:01 UTC
Test-Scenario via WSRP:

Step 1:
We have a remote portlet with a resource link and the attribute “escapeXML=”true”
                <a href="<portlet:resourceURL id="pdfResourceURL" escapeXml="true" />">escaped resource link</a><br/>

Step 2:
If we are calling the remote portlet, the generated url is not encoded and looks like:
       …&windowid=32ca0b9a-9b72-43cc-b84d-d18c2dfecf8e-&mode=view">escaped resource link</a><br/>

Step 3:
If we are calling the portlet on a local jboss, the url is encoded.

Pre-analysis

1) Local-Portlets:
If the portlet is called on a local jboss the class "org.gatein.pc.controller.impl.PortletURLRenderer" is used, which takes care about the encoding issues:

format.getWantEscapeXML() == Boolean.TRUE ? "&amp;" : "&";

2) Remote-Portlets:
If the portlet is called on a remote jboss the class "org.gatein.wsrp.producer.handlers.processors.WSRPPortletInvocationContext" (method: renderURL) is called which ignores the
the "wantEscapeXML" flag of the URLFormat and does not encode the url.

Workaround
We also found a workaround for remote portlets with the help of the c:out tag. So we are saving the URL  in a variable and using the escape functionality of the c:out tag.

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<portlet:resourceURL var="pdfResourceVar" id="pdfResourceURL" escapeXml="false" />
<a href='<c:out value="${pdfResourceVar}" escapeXml="true"/> '>ESCAPED true</a><br/>


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