portals-pluto-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edalqu...@apache.org
Subject svn commit: r1025697 - /portals/pluto/branches/pluto-2.0.x/pluto-taglib/src/main/java/org/apache/pluto/tags/ResourceURLTag286.java
Date Wed, 20 Oct 2010 19:44:06 GMT
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);



Mime
View raw message