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 ed...@apache.org on 2010/10/20 21:44:06 UTC

svn commit: r1025697 - /portals/pluto/branches/pluto-2.0.x/pluto-taglib/src/main/java/org/apache/pluto/tags/ResourceURLTag286.java

Author: edalquist
Date: Wed Oct 20 19:44:05 2010
New Revision: 1025697

URL: http://svn.apache.org/viewvc?rev=1025697&view=rev
Log:
PLUTO-599 Make the resource url tag check the javax.portlet.escapeXml setting

Modified:
    portals/pluto/branches/pluto-2.0.x/pluto-taglib/src/main/java/org/apache/pluto/tags/ResourceURLTag286.java

Modified: portals/pluto/branches/pluto-2.0.x/pluto-taglib/src/main/java/org/apache/pluto/tags/ResourceURLTag286.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/pluto-2.0.x/pluto-taglib/src/main/java/org/apache/pluto/tags/ResourceURLTag286.java?rev=1025697&r1=1025696&r2=1025697&view=diff
==============================================================================
--- portals/pluto/branches/pluto-2.0.x/pluto-taglib/src/main/java/org/apache/pluto/tags/ResourceURLTag286.java (original)
+++ portals/pluto/branches/pluto-2.0.x/pluto-taglib/src/main/java/org/apache/pluto/tags/ResourceURLTag286.java Wed Oct 20 19:44:05 2010
@@ -17,7 +17,10 @@
 package org.apache.pluto.tags;
 
 
+import java.util.Map;
+
 import javax.portlet.BaseURL;
+import javax.portlet.PortletConfig;
 import javax.portlet.PortletResponse;
 import javax.portlet.RenderResponse;
 import javax.portlet.ResourceResponse;
@@ -55,6 +58,21 @@ public class ResourceURLTag286 extends B
 	 */
 	@Override
 	public int doStartTag() throws JspException {
+	    PortletConfig portletConfig = 
+            (PortletConfig) pageContext.getRequest().getAttribute(Constants.PORTLET_CONFIG);
+	    
+        Map<String,String[]> containerRuntimeOptions = portletConfig.getContainerRuntimeOptions();
+        if (containerRuntimeOptions != null){
+            String[] result = containerRuntimeOptions.get(Constants.ESCAPE_XML_RUNTIME_OPTION);
+            if (result != null){
+                if (result.length > 0){
+                    if (result[0].equals(true))
+                        escapeXml = true;
+                    else if (result[0].equals(false))
+                        escapeXml = false;
+                }
+            }
+        }
 		       
         PortletResponse portletResponse = (PortletResponse) pageContext.getRequest()
             .getAttribute(Constants.PORTLET_RESPONSE);