Bug 981746 - escapeXml feature is ignored and the url is not encoded in wsrp.
escapeXml feature is ignored and the url is not encoded in wsrp.
Product: JBoss Enterprise Portal Platform 5
Classification: JBoss
Component: Portal (Show other bugs)
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Thomas Heute
Depends On:
  Show dependency treegraph
Reported: 2013-07-05 12:57 EDT by Gary Hu
Modified: 2014-09-26 03:50 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-09-26 03:50:26 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker GTNWSRP-368 Major Resolved escapeXml feature is ignored in wsrp. 2013-10-04 03:09:58 EDT

  None (edit)
Comment 1 Gary Hu 2013-07-05 12:59:01 EDT
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.


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.

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.