You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by at...@apache.org on 2008/11/19 17:16:04 UTC

svn commit: r719002 - in /portals/pluto/trunk: pluto-taglib/src/main/java/org/apache/pluto/tags/BaseURLTag.java pluto-testsuite/src/main/webapp/jsp/introduction.jsp

Author: ate
Date: Wed Nov 19 08:16:03 2008
New Revision: 719002

URL: http://svn.apache.org/viewvc?rev=719002&view=rev
Log:
PLUTO-523: fixing escapeXml encoding for the ActionParameterTest
The error turned out to be caused by incorrectly double encoding of the url: first by the PortletURL (correct, Portlet API 2.0 default), secondly by the jstl c:out tag.
This probably is a left-over effect of migrating the jsp from Portlet API 1.0 (which didn't specify/do xml encoding) to Portlet API 2.0 usage.
Fixed by making this explicit in the jsp using  PortletURL tag escapeXml="true" (which is the default anyway) and <c:out escapeXml="false">

Modified:
    portals/pluto/trunk/pluto-taglib/src/main/java/org/apache/pluto/tags/BaseURLTag.java
    portals/pluto/trunk/pluto-testsuite/src/main/webapp/jsp/introduction.jsp

Modified: portals/pluto/trunk/pluto-taglib/src/main/java/org/apache/pluto/tags/BaseURLTag.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-taglib/src/main/java/org/apache/pluto/tags/BaseURLTag.java?rev=719002&r1=719001&r2=719002&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-taglib/src/main/java/org/apache/pluto/tags/BaseURLTag.java (original)
+++ portals/pluto/trunk/pluto-taglib/src/main/java/org/apache/pluto/tags/BaseURLTag.java Wed Nov 19 08:16:03 2008
@@ -346,8 +346,7 @@
      */
     protected String doEscapeXml(String str) {
     	if(!isEmpty(str)){
-// DST: this is breaking the "ActionParameterTest", since a raw URL with & is getting turned int &amp;, which fails to parse correctly
-//    	    str = str.replaceAll("&", "&amp;");
+    	    str = str.replaceAll("&", "&amp;");
     		str = str.replaceAll("<", "&lt;");
     		str = str.replaceAll(">", "&gt;");
     		str = str.replaceAll("\"", "&#034;");

Modified: portals/pluto/trunk/pluto-testsuite/src/main/webapp/jsp/introduction.jsp
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-testsuite/src/main/webapp/jsp/introduction.jsp?rev=719002&r1=719001&r2=719002&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-testsuite/src/main/webapp/jsp/introduction.jsp (original)
+++ portals/pluto/trunk/pluto-testsuite/src/main/webapp/jsp/introduction.jsp Wed Nov 19 08:16:03 2008
@@ -47,7 +47,7 @@
         </td>
         
         <%-- Generate portlet action URL: Start =========================== --%>
-        <portlet:actionURL secure='<%= renderRequest.isSecure() ? "True" : "False" %>'
+        <portlet:actionURL secure='<%= renderRequest.isSecure() ? "True" : "False" %>' escapeXml="true"
                            var="url">
           <portlet:param name="testId"
                          value='<%= ((LoopTagStatus) pageContext.getAttribute("status")).getIndex() + "" %>'/>
@@ -65,7 +65,7 @@
         <%-- Generate portlet action URL: End ============================= --%>
         
         <td>
-          <a href="<c:out value="${url}"/>">Test</a>
+          <a href="<c:out value="${url}" escapeXml="false"/>">Test</a>
         </td>
       </tr>
     </c:forEach>