Author: remy.maucherat(a)jboss.com
Date: 2009-05-27 19:00:30 -0400 (Wed, 27 May 2009)
New Revision: 1069
Modified:
trunk/java/org/apache/catalina/core/StandardContext.java
trunk/java/org/apache/catalina/startup/ContextConfig.java
trunk/java/org/apache/catalina/startup/TldRuleSet.java
Log:
- Fix some details about taglibs.
Modified: trunk/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContext.java 2009-05-27 22:27:25 UTC (rev
1068)
+++ trunk/java/org/apache/catalina/core/StandardContext.java 2009-05-27 23:00:30 UTC (rev
1069)
@@ -421,8 +421,20 @@
*/
protected String instanceListeners[] = new String[0];
+
+ /**
+ * The set of JSP property groups defined for the webapp, keyed by pattern.
+ */
+ protected HashMap<String, JspPropertyGroup> jspPropertyGroups = new
HashMap<String, JspPropertyGroup>();
+
/**
+ * The set of taglibs defined for the webapp, keyed by uri.
+ */
+ protected HashMap<String, TagLibraryInfo> jspTagLibraries = new
HashMap<String, TagLibraryInfo>();
+
+
+ /**
* The logical name of the webapp, if any which may be used in other descriptors.
*/
protected String logicalName = null;
@@ -2273,7 +2285,7 @@
public void addJspPropertyGroup(JspPropertyGroup propertyGroup) {
// Add any JSP mapping specified, as it needs to be mapped to the JSP Servlet
addJspMapping(propertyGroup.getUrlPattern());
- // FIXME: store locally to pass to the Jasper plugin later on
+ jspPropertyGroups.put(propertyGroup.getUrlPattern(), propertyGroup);
}
@@ -2288,7 +2300,7 @@
for (int i = 0; i < listeners.length; i++) {
addApplicationListener(listeners[i]);
}
- // FIXME: store locally to pass to the Jasper plugin later on
+ jspTagLibraries.put(tagLibraryInfo.getUri(), tagLibraryInfo);
}
@@ -2495,7 +2507,7 @@
results[welcomeFiles.length] = name;
welcomeFiles = results;
- postWelcomeFiles();
+ postContextAttributes();
fireContainerEvent("addWelcomeFile", name);
}
@@ -3418,7 +3430,7 @@
welcomeFiles = results;
// Inform interested listeners
- postWelcomeFiles();
+ postContextAttributes();
fireContainerEvent("removeWelcomeFile", name);
}
@@ -4140,7 +4152,7 @@
// Create context attributes that will be required
if (ok) {
- postWelcomeFiles();
+ postContextAttributes();
}
if (ok) {
@@ -4792,13 +4804,16 @@
/**
- * Post a copy of our current list of welcome files as a servlet context
- * attribute, so that the default servlet can find them.
+ * Create mandatory servlet context attributes.
*/
- protected void postWelcomeFiles() {
+ protected void postContextAttributes() {
getServletContext().setAttribute("org.apache.catalina.WELCOME_FILES",
welcomeFiles);
+
getServletContext().setAttribute("org.apache.catalina.jsp.PROPERTY_GROUPS",
+ jspPropertyGroups);
+
getServletContext().setAttribute("org.apache.catalina.jsp.TAG_LIBRARIES",
+ jspTagLibraries);
}
Modified: trunk/java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-05-27 22:27:25 UTC (rev
1068)
+++ trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-05-27 23:00:30 UTC (rev
1069)
@@ -1999,6 +1999,10 @@
context.removeTaglib(taglibs[i]);
}
+ // FIXME: remove JSP property groups
+
+ // FIXME: remove JSP tag libraries
+
// Removing welcome files
String[] welcomeFiles = context.findWelcomeFiles();
for (i = 0; i < welcomeFiles.length; i++) {
Modified: trunk/java/org/apache/catalina/startup/TldRuleSet.java
===================================================================
--- trunk/java/org/apache/catalina/startup/TldRuleSet.java 2009-05-27 22:27:25 UTC (rev
1068)
+++ trunk/java/org/apache/catalina/startup/TldRuleSet.java 2009-05-27 23:00:30 UTC (rev
1069)
@@ -87,6 +87,9 @@
*/
public void addRuleInstances(Digester digester) {
+ // Parse uri and prefix attributes
+ digester.addSetProperties(prefix + "taglib");
+
digester.addCallMethod(prefix + "taglib/tlibversion",
"setTlibversion", 0);
digester.addCallMethod(prefix + "taglib/tlib-version",
@@ -100,7 +103,7 @@
digester.addCallMethod(prefix + "taglib/short-name",
"setShortname", 0);
digester.addCallMethod(prefix + "taglib/uri",
- "setUri", 0);
+ "setUrn", 0);
digester.addCallMethod(prefix + "taglib/info",
"setInfo", 0);
digester.addCallMethod(prefix + "taglib/description",