Author: markt Date: Wed Jan 8 17:51:48 2014 New Revision: 1556589 URL: http://svn.apache.org/r1556589 Log: Back-port some XML processing improvements (part 2) JspC passes configuration with ServletContext init params so a real implementation is required. This is essentially a back-port of http://svn.apache.org/r1552306
Modified: tomcat/tc6.0.x/trunk/STATUS.txt tomcat/tc6.0.x/trunk/java/org/apache/jasper/servlet/JspCServletContext.java Modified: tomcat/tc6.0.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1556589&r1=1556588&r2=1556589&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Wed Jan 8 17:51:48 2014 @@ -40,14 +40,6 @@ PATCHES PROPOSED TO BACKPORT: exclude lists in TldConfig.java, TldLocationsCache.java, see r1476932. -1: -* Back-port some XML processing improvements (part 2) - JspC passes configuration with ServletContext init params so a real - implementation is required. This is essentially a back-port of - http://svn.apache.org/r1552306 - http://people.apache.org/~markt/patches/2013-12-19-xml-prep-part2-tc6-v1.patch - +1: markt, kkolinko, remm, jboynes - -1: - * Back-port some XML processing improvements (part 3) Add the new descriptor package Note I am generating the patches using git so the patch shows whole new files Modified: tomcat/tc6.0.x/trunk/java/org/apache/jasper/servlet/JspCServletContext.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/jasper/servlet/JspCServletContext.java?rev=1556589&r1=1556588&r2=1556589&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/jasper/servlet/JspCServletContext.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/jasper/servlet/JspCServletContext.java Wed Jan 8 17:51:48 2014 @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -28,6 +28,7 @@ import java.util.HashSet; import java.util.Hashtable; import java.util.Set; import java.util.Vector; +import java.util.concurrent.ConcurrentHashMap; import javax.servlet.RequestDispatcher; import javax.servlet.Servlet; @@ -55,6 +56,12 @@ public class JspCServletContext implemen /** + * Servlet context initialization parameters. + */ + private final ConcurrentHashMap<String,String> myParameters; + + + /** * The log writer we will write log messages to. */ protected PrintWriter myLogWriter; @@ -78,6 +85,7 @@ public class JspCServletContext implemen public JspCServletContext(PrintWriter aLogWriter, URL aResourceBaseURL) { myAttributes = new Hashtable(); + myParameters = new ConcurrentHashMap<String,String>(); myLogWriter = aLogWriter; myResourceBaseURL = aResourceBaseURL; @@ -137,9 +145,7 @@ public class JspCServletContext implemen * @param name Name of the requested parameter */ public String getInitParameter(String name) { - - return (null); - + return myParameters.get(name); } @@ -148,9 +154,7 @@ public class JspCServletContext implemen * parameters. */ public Enumeration getInitParameterNames() { - - return (new Vector().elements()); - + return myParameters.keys(); } @@ -218,8 +222,8 @@ public class JspCServletContext implemen } } - - + + /** * Return a request dispatcher for the specified context-relative path. * @@ -438,6 +442,6 @@ public class JspCServletContext implemen public boolean setInitParameter(String name, String value) { - return false; + return myParameters.putIfAbsent(name, value) == null; } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org