JBossWeb SVN: r1078 - in trunk/java/org/apache/catalina: startup and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-06-03 11:47:47 -0400 (Wed, 03 Jun 2009)
New Revision: 1078
Modified:
trunk/java/org/apache/catalina/deploy/jsp/TagLibraryInfo.java
trunk/java/org/apache/catalina/startup/ContextConfig.java
Log:
- Add another path field.
Modified: trunk/java/org/apache/catalina/deploy/jsp/TagLibraryInfo.java
===================================================================
--- trunk/java/org/apache/catalina/deploy/jsp/TagLibraryInfo.java 2009-06-03 14:05:53 UTC (rev 1077)
+++ trunk/java/org/apache/catalina/deploy/jsp/TagLibraryInfo.java 2009-06-03 15:47:47 UTC (rev 1078)
@@ -84,8 +84,16 @@
*/
protected String info; // optional
+ /**
+ * The location of the taglib, which should be the JAR path, or empty if exploded.
+ */
protected String location;
+ /**
+ * The access path for the taglib, relative to the location.
+ */
+ protected String path;
+
public String getPrefix() {
return prefix;
}
@@ -190,4 +198,12 @@
this.location = location;
}
+ public String getPath() {
+ return path;
+ }
+
+ public void setPath(String path) {
+ this.path = path;
+ }
+
}
Modified: trunk/java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-06-03 14:05:53 UTC (rev 1077)
+++ trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-06-03 15:47:47 UTC (rev 1078)
@@ -630,6 +630,7 @@
tldDigester.reset();
}
tagLibraryInfo.setLocation("");
+ tagLibraryInfo.setPath(tldPath);
context.addJspTagLibrary(tagLibraryInfo);
}
}
@@ -661,7 +662,8 @@
jarFile = new JarFile(jarPath);
Iterator<String> jarTLDsIterator = TLDs.get(jarPath).iterator();
while (jarTLDsIterator.hasNext()) {
- stream = jarFile.getInputStream(jarFile.getEntry(jarTLDsIterator.next()));
+ String tldPath = jarTLDsIterator.next();
+ stream = jarFile.getInputStream(jarFile.getEntry(tldPath));
synchronized (tldDigester) {
TagLibraryInfo tagLibraryInfo = new TagLibraryInfo();
try {
@@ -678,6 +680,7 @@
}
}
tagLibraryInfo.setLocation(jarPath);
+ tagLibraryInfo.setPath(tldPath);
context.addJspTagLibrary(tagLibraryInfo);
}
}
15 years, 6 months
JBossWeb SVN: r1077 - in trunk/java/org/apache/catalina: startup and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-06-03 10:05:53 -0400 (Wed, 03 Jun 2009)
New Revision: 1077
Modified:
trunk/java/org/apache/catalina/deploy/jsp/TagLibraryInfo.java
trunk/java/org/apache/catalina/startup/ContextConfig.java
Log:
- Taglibs may declare tag files, which are more or less JSPs. Jasper must thus know the Jar in which the TLD was located.
Modified: trunk/java/org/apache/catalina/deploy/jsp/TagLibraryInfo.java
===================================================================
--- trunk/java/org/apache/catalina/deploy/jsp/TagLibraryInfo.java 2009-06-03 12:36:00 UTC (rev 1076)
+++ trunk/java/org/apache/catalina/deploy/jsp/TagLibraryInfo.java 2009-06-03 14:05:53 UTC (rev 1077)
@@ -84,6 +84,8 @@
*/
protected String info; // optional
+ protected String location;
+
public String getPrefix() {
return prefix;
}
@@ -180,4 +182,12 @@
this.validator = validator;
}
+ public String getLocation() {
+ return location;
+ }
+
+ public void setLocation(String location) {
+ this.location = location;
+ }
+
}
Modified: trunk/java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-06-03 12:36:00 UTC (rev 1076)
+++ trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-06-03 14:05:53 UTC (rev 1077)
@@ -629,6 +629,7 @@
} finally {
tldDigester.reset();
}
+ tagLibraryInfo.setLocation("");
context.addJspTagLibrary(tagLibraryInfo);
}
}
@@ -662,8 +663,9 @@
while (jarTLDsIterator.hasNext()) {
stream = jarFile.getInputStream(jarFile.getEntry(jarTLDsIterator.next()));
synchronized (tldDigester) {
+ TagLibraryInfo tagLibraryInfo = new TagLibraryInfo();
try {
- tldDigester.push(context);
+ tldDigester.push(tagLibraryInfo);
tldDigester.parse(new InputSource(stream));
} finally {
tldDigester.reset();
@@ -675,6 +677,8 @@
}
}
}
+ tagLibraryInfo.setLocation(jarPath);
+ context.addJspTagLibrary(tagLibraryInfo);
}
}
} catch (Exception e) {
15 years, 6 months
JBossWeb SVN: r1076 - trunk/java/org/apache/catalina/deploy/jsp.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-06-03 08:36:00 -0400 (Wed, 03 Jun 2009)
New Revision: 1076
Modified:
trunk/java/org/apache/catalina/deploy/jsp/TagLibraryInfo.java
Log:
- Fix type oops.
Modified: trunk/java/org/apache/catalina/deploy/jsp/TagLibraryInfo.java
===================================================================
--- trunk/java/org/apache/catalina/deploy/jsp/TagLibraryInfo.java 2009-06-03 11:25:08 UTC (rev 1075)
+++ trunk/java/org/apache/catalina/deploy/jsp/TagLibraryInfo.java 2009-06-03 12:36:00 UTC (rev 1076)
@@ -19,9 +19,6 @@
import java.util.ArrayList;
-import javax.servlet.jsp.tagext.TagFileInfo;
-import javax.servlet.jsp.tagext.TagInfo;
-
public class TagLibraryInfo {
// Protected fields
15 years, 6 months
JBossWeb SVN: r1075 - in trunk/java: javax/servlet/annotation and 2 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-06-03 07:25:08 -0400 (Wed, 03 Jun 2009)
New Revision: 1075
Modified:
trunk/java/javax/servlet/ServletContainerInitializer.java
trunk/java/javax/servlet/ServletContext.java
trunk/java/javax/servlet/annotation/MultipartConfig.java
trunk/java/javax/servlet/http/HttpServletRequest.java
trunk/java/javax/servlet/http/HttpServletRequestWrapper.java
trunk/java/org/apache/catalina/connector/Request.java
trunk/java/org/apache/catalina/connector/RequestFacade.java
Log:
- Update the API (super minor).
Modified: trunk/java/javax/servlet/ServletContainerInitializer.java
===================================================================
--- trunk/java/javax/servlet/ServletContainerInitializer.java 2009-06-02 16:17:09 UTC (rev 1074)
+++ trunk/java/javax/servlet/ServletContainerInitializer.java 2009-06-03 11:25:08 UTC (rev 1075)
@@ -40,13 +40,20 @@
import java.util.Set;
/**
- * An implementation of this interface can be provided by a library /
- * runtime to get notified by the container for the classes / interfaces
- * that it expresses interest via the <tt>@HandlesTypes</tt> annotation. If
- * there is no <tt>@HandlesTypes</tt> annotation on an implementation of this
- * interface, the container MUST invoke the <tt>onStartup</tt> method once for
- * every webapp passing it a <tt>null</tt> set of classes.
+ * Interface which may be implemented by a library/runtime in order
+ * to be notified by the container of any of the classes/interfaces
+ * in which it has expressed interest via the
+ * {@link javax.servlet.annotation.HandlesTypes HandlesTypes} annotation.
*
+ * <p>If an implementation of this interface does not have any such
+ * annotation, the container must pass a <tt>null</tt> set of classes to
+ * its {@link #onStartup} method.
+ *
+ * <p>Implementations of this interface may be declared by a JAR file
+ * resource located inside the <tt>META-INF/services</tt> directory and
+ * named for the fully qualified class name of this interface, and will be
+ * discovered using the runtime's service provider lookup mechanism.
+ *
* @see javax.servlet.annotation.HandlesTypes
*
* @since Servlet 3.0
@@ -54,12 +61,27 @@
public interface ServletContainerInitializer {
/**
- * @param c The set of classes that an implementation of ServletContainerInitializer expressed interest on
- * via the <tt>HandlesTypes</tt> annotation. If there is no <tt>HandlesTypes</tt> annotation on the implementation
- * of the ServletContainerInitializer, a <tt>null</tt> set of classes will be passed
+ * Notifies this <tt>ServletContainerInitializer</tt> of the startup
+ * of the application represented by the given <tt>ServletContext</tt>.
*
- * @param ctx The <tt>ServletContext</tt> instance in which the types defined via the <tt>HandlesTypes</tt>
- * are found.
+ * <p>If this <tt>ServletContainerInitializer</tt> is bundled in a JAR
+ * file inside the <tt>WEB-INF/lib</tt> directory of an application,
+ * its <tt>onStartup</tt> method will be invoked only once during the
+ * startup of the bundling application. If this
+ * <tt>ServletContainerInitializer</tt> is bundled inside a JAR file
+ * outside of any <tt>WEB-INF/lib</tt> directory, but still
+ * discoverable by the runtime's service provider lookup mechanism,
+ * its <tt>onStartup</tt> method will be invoked every time an
+ * application is started.
+ *
+ * @param c The set of classes in which this
+ * <tt>ServletContainerInitializer</tt> has expressed interest via
+ * the <tt>HandlesTypes</tt> annotation, or <tt>null</tt> if this
+ * <tt>ServletContainerInitializer</tt> does not have any such
+ * annotation
+ *
+ * @param ctx The <tt>ServletContext</tt> instance in which the types
+ * defined via the <tt>HandlesTypes</tt> annotation were found.
*/
public void onStartup(Set<Class<?>> c, ServletContext ctx);
}
Modified: trunk/java/javax/servlet/ServletContext.java
===================================================================
--- trunk/java/javax/servlet/ServletContext.java 2009-06-02 16:17:09 UTC (rev 1074)
+++ trunk/java/javax/servlet/ServletContext.java 2009-06-03 11:25:08 UTC (rev 1075)
@@ -471,13 +471,13 @@
* appropriate to the computer and operating system on
* which the servlet container is running, including the
* proper path separators.
- * Paths to resources located inside the <tt>/META-INF/resources</tt>
- * directory of a JAR file inside the application's <tt>/WEB-INF/lib</tt>
- * directory are returned using this format:
- * <tt><absolute-file-path-on-disk>/WEB-INF/lib/<name-of-jar>!/META-INF/resources/<path></tt>,
- * where <tt><path></tt> corresponds to the <tt>path</tt>
- * argument passed to this method.
*
+ * <p>Resources inside the <tt>/META-INF/resources</tt>
+ * directories of JAR files bundled in the application's
+ * <tt>/WEB-INF/lib</tt> directory must be considered only if the
+ * container has unpacked them from their containing JAR file, in
+ * which case the path to the unpacked location must be returned.
+ *
* <p>This method returns <code>null</code> if the servlet container
* is unable to translate the given <i>virtual</i> path to a
* <i>real</i> path.
Modified: trunk/java/javax/servlet/annotation/MultipartConfig.java
===================================================================
--- trunk/java/javax/servlet/annotation/MultipartConfig.java 2009-06-02 16:17:09 UTC (rev 1074)
+++ trunk/java/javax/servlet/annotation/MultipartConfig.java 2009-06-03 11:25:08 UTC (rev 1075)
@@ -47,25 +47,26 @@
/**
* The directory location where files will be stored
- *
*/
String location() default "";
/**
- * the maximum size allowed for files uploaded
- *
+ * The maximum size allowed for uploaded files.
+ *
+ * <p>The default is <tt>-1L</tt>, which means unlimited.
*/
- long maxFileSize() default 0L;
+ long maxFileSize() default -1L;
/**
- * The maximum size of a multi-part/form-data request allowed
- *
+ * The maximum size allowed for <tt>multipart/form-data</tt>
+ * requests
+ *
+ * <p>The default is <tt>-1L</tt>, which means unlimited.
*/
- long maxRequestSize() default 0L;
+ long maxRequestSize() default -1L;
/**
* The size threshold after which the file will be written to disk
- *
*/
int fileSizeThreshold() default 0;
}
Modified: trunk/java/javax/servlet/http/HttpServletRequest.java
===================================================================
--- trunk/java/javax/servlet/http/HttpServletRequest.java 2009-06-02 16:17:09 UTC (rev 1074)
+++ trunk/java/javax/servlet/http/HttpServletRequest.java 2009-06-03 11:25:08 UTC (rev 1075)
@@ -737,6 +737,8 @@
* NOT establish the message and
* HTTP status code to be returned
* to the user).
+ *
+ * @since Servlet 3.0
*/
public boolean authenticate(HttpServletResponse response)
throws IOException,ServletException;
@@ -776,6 +778,8 @@
* to the call to login), or if
* validation of the provided
* username and password fails.
+ *
+ * @since Servlet 3.0
*/
public void login(String username, String password)
throws ServletException;
@@ -786,30 +790,59 @@
* <code>getUserPrincipal</code>, <code>getRemoteUser</code>,
* and <code>getAuthType</code> is called on the request.
*
- * @exception ServletException ff logout fails.
+ * @exception ServletException if logout fails
+ *
+ * @since Servlet 3.0
*/
public void logout() throws ServletException;
+
/**
- * Retrieves all the parts of the multi-part/form-data http message
+ * Gets all the {@link Part} components of this request, provided
+ * that it is of type <tt>multipart/form-data</tt>.
*
- * @return An <code>Iterable</code> for all the parts of the multi-part/form-data request
+ * <p>If this request is of type <tt>multipart/form-data</tt>, but
+ * does not contain any Part components, the returned
+ * <tt>Iterable</tt> will be empty.
+ *
+ * @return A (possibly empty) <code>Iterable</code> over all the
+ * Part components of this request
+ *
+ * @throws ServletException if this request is not of type
+ * <tt>multipart/form-data</tt>
+ * @throws IllegalStateException if the request body is larger than
+ * <tt>maxRequestSize</tt>, or any Part in the request is larger than
+ * <tt>maxFileSize</tt>
+ *
+ * @see javax.servlet.annotation.MultipartConfig#maxFileSize
+ * @see javax.servlet.annotation.MultipartConfig#maxRequestSize
+ *
+ * @since Servlet 3.0
*/
- public Iterable<Part> getParts();
+ public Iterable<Part> getParts() throws ServletException;
+
/**
- * Returns the part specified by the name.
+ * Gets the {@link Part} with the given name.
*
- * @param name the name of the part
- * @return The part being requested for by name.
- * @exception IllegalArgumentException If the name specified does not exist
+ * @param name the name of the requested Part
*
+ * @return The Part with the given name, or <tt>null</tt> if this
+ * request is of type <tt>multipart/form-data</tt>, but does not
+ * contain the requested Part
+ *
+ * @throws ServletException if this request is not of type
+ * <tt>multipart/form-data</tt>
+ * @throws IllegalStateException if the request body is larger than
+ * <tt>maxRequestSize</tt>, or any Part in the request is larger than
+ * <tt>maxFileSize</tt>
+ *
+ * @see javax.servlet.annotation.MultipartConfig#maxFileSize
+ * @see javax.servlet.annotation.MultipartConfig#maxRequestSize
+ *
+ * @since Servlet 3.0
*/
- public Part getPart(String name) throws IllegalArgumentException;
-
-
-
-
+ public Part getPart(String name) throws ServletException;
}
Modified: trunk/java/javax/servlet/http/HttpServletRequestWrapper.java
===================================================================
--- trunk/java/javax/servlet/http/HttpServletRequestWrapper.java 2009-06-02 16:17:09 UTC (rev 1074)
+++ trunk/java/javax/servlet/http/HttpServletRequestWrapper.java 2009-06-03 11:25:08 UTC (rev 1075)
@@ -303,6 +303,8 @@
/**
* The default behavior of this method is to call authenticate on the
* wrapped request object.
+ *
+ * @since Servlet 3.0
*/
public boolean authenticate(HttpServletResponse response)
throws IOException, ServletException {
@@ -312,7 +314,9 @@
/**
* The default behavior of this method is to call login on the wrapped
- * request object
+ * request object.
+ *
+ * @since Servlet 3.0
*/
public void login(String username, String password)
throws ServletException {
@@ -322,33 +326,33 @@
/**
* The default behavior of this method is to call login on the wrapped
- * request object
+ * request object.
+ *
+ * @since Servlet 3.0
*/
public void logout() throws ServletException {
this._getHttpServletRequest().logout();
}
/**
- * Retrieves all the parts of the multi-part/form-data http message
+ * The default behavior of this method is to call getParts on the wrapped
+ * request object.
*
- * @return An <code>Iterable</code> for all the parts of the multi-part/form-data request
+ * @since Servlet 3.0
*/
- public Iterable<Part> getParts() {
+ public Iterable<Part> getParts() throws ServletException {
return this._getHttpServletRequest().getParts();
}
/**
- * Returns the part specified by the name.
+ * The default behavior of this method is to call getPart on the wrapped
+ * request object.
*
- * @param name the name of the part
- * @return The part being requested for by name.
- * @exception IllegalArgumentException If the name specified does not exist
- *
+ * @since Servlet 3.0
*/
- public Part getPart(String name) throws IllegalArgumentException {
+ public Part getPart(String name) throws ServletException {
return this._getHttpServletRequest().getPart(name);
}
-
}
Modified: trunk/java/org/apache/catalina/connector/Request.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Request.java 2009-06-02 16:17:09 UTC (rev 1074)
+++ trunk/java/org/apache/catalina/connector/Request.java 2009-06-03 11:25:08 UTC (rev 1075)
@@ -3041,20 +3041,21 @@
}
- public Part getPart(String name) throws IllegalArgumentException {
+ public Part getPart(String name) throws ServletException {
if (parts == null) {
parseMultipart();
}
Part result = parts.get(name);
if (result == null) {
- throw new IllegalArgumentException();
+ // FIXME: error message
+ throw new ServletException();
} else {
return result;
}
}
- public Iterable<Part> getParts() {
+ public Iterable<Part> getParts() throws ServletException {
if (parts == null) {
parseMultipart();
}
Modified: trunk/java/org/apache/catalina/connector/RequestFacade.java
===================================================================
--- trunk/java/org/apache/catalina/connector/RequestFacade.java 2009-06-02 16:17:09 UTC (rev 1074)
+++ trunk/java/org/apache/catalina/connector/RequestFacade.java 2009-06-03 11:25:08 UTC (rev 1075)
@@ -1122,7 +1122,7 @@
}
- public Part getPart(String name) throws IllegalArgumentException {
+ public Part getPart(String name) throws ServletException {
if (request == null) {
throw new IllegalStateException(
sm.getString("requestFacade.nullRequest"));
@@ -1132,7 +1132,7 @@
}
- public Iterable<Part> getParts() {
+ public Iterable<Part> getParts() throws ServletException {
if (request == null) {
throw new IllegalStateException(
sm.getString("requestFacade.nullRequest"));
15 years, 6 months
JBossWeb SVN: r1074 - in trunk: java/org/apache/catalina and 3 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-06-02 12:17:09 -0400 (Tue, 02 Jun 2009)
New Revision: 1074
Modified:
trunk/PATCHES.txt
trunk/java/org/apache/catalina/Container.java
trunk/java/org/apache/catalina/core/ContainerBase.java
trunk/java/org/apache/catalina/session/StandardSession.java
trunk/webapps/docs/changelog.xml
Log:
- Expose Container.fireContainerEvent, since it is used, and became public a while ago.
Modified: trunk/PATCHES.txt
===================================================================
--- trunk/PATCHES.txt 2009-06-02 14:12:44 UTC (rev 1073)
+++ trunk/PATCHES.txt 2009-06-02 16:17:09 UTC (rev 1074)
@@ -71,3 +71,6 @@
770876
Windows 64 bit stuff ... Zzzzz
+
+781036
+Some configBase creation flag
Modified: trunk/java/org/apache/catalina/Container.java
===================================================================
--- trunk/java/org/apache/catalina/Container.java 2009-06-02 14:12:44 UTC (rev 1073)
+++ trunk/java/org/apache/catalina/Container.java 2009-06-02 16:17:09 UTC (rev 1074)
@@ -424,6 +424,17 @@
/**
+ * Notify all container event listeners that a particular event has
+ * occurred for this Container. The default implementation performs
+ * this notification synchronously using the calling thread.
+ *
+ * @param type Event type
+ * @param data Event data
+ */
+ public void fireContainerEvent(String type, Object data);
+
+
+ /**
* Process the specified Request, and generate the corresponding Response,
* according to the design of this particular Container.
*
Modified: trunk/java/org/apache/catalina/core/ContainerBase.java
===================================================================
--- trunk/java/org/apache/catalina/core/ContainerBase.java 2009-06-02 14:12:44 UTC (rev 1073)
+++ trunk/java/org/apache/catalina/core/ContainerBase.java 2009-06-02 16:17:09 UTC (rev 1074)
@@ -1413,9 +1413,6 @@
}
- // ------------------------------------------------------ Protected Methods
-
-
/**
* Notify all container event listeners that a particular event has
* occurred for this Container. The default implementation performs
@@ -1439,6 +1436,9 @@
}
+ // ------------------------------------------------------ Protected Methods
+
+
/**
* Return the abbreviated name of this container for logging messsages
*/
Modified: trunk/java/org/apache/catalina/session/StandardSession.java
===================================================================
--- trunk/java/org/apache/catalina/session/StandardSession.java 2009-06-02 14:12:44 UTC (rev 1073)
+++ trunk/java/org/apache/catalina/session/StandardSession.java 2009-06-02 16:17:09 UTC (rev 1074)
@@ -24,7 +24,6 @@
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
-import java.lang.reflect.Method;
import java.security.AccessController;
import java.security.Principal;
import java.security.PrivilegedAction;
@@ -140,24 +139,6 @@
/**
- * The <code>java.lang.Method</code> for the
- * <code>fireContainerEvent()</code> method of the
- * <code>org.apache.catalina.core.StandardContext</code> method,
- * if our Context implementation is of this class. This value is
- * computed dynamically the first time it is needed, or after
- * a session reload (since it is declared transient).
- */
- protected transient Method containerEventMethod = null;
-
-
- /**
- * The method signature for the <code>fireContainerEvent</code> method.
- */
- protected static final Class containerEventTypes[] =
- { String.class, Object.class };
-
-
- /**
* The time this session was created, in milliseconds since midnight,
* January 1, 1970 GMT.
*/
@@ -379,18 +360,12 @@
HttpSessionListener listener =
(HttpSessionListener) listeners[i];
try {
- fireContainerEvent(context,
- "beforeSessionCreated",
- listener);
+ context.fireContainerEvent("beforeSessionCreated", listener);
listener.sessionCreated(event);
- fireContainerEvent(context,
- "afterSessionCreated",
- listener);
+ context.fireContainerEvent("afterSessionCreated", listener);
} catch (Throwable t) {
try {
- fireContainerEvent(context,
- "afterSessionCreated",
- listener);
+ context.fireContainerEvent("afterSessionCreated", listener);
} catch (Exception e) {
;
}
@@ -682,18 +657,12 @@
HttpSessionListener listener =
(HttpSessionListener) listeners[j];
try {
- fireContainerEvent(context,
- "beforeSessionDestroyed",
- listener);
+ context.fireContainerEvent("beforeSessionDestroyed", listener);
listener.sessionDestroyed(event);
- fireContainerEvent(context,
- "afterSessionDestroyed",
- listener);
+ context.fireContainerEvent("afterSessionDestroyed", listener);
} catch (Throwable t) {
try {
- fireContainerEvent(context,
- "afterSessionDestroyed",
- listener);
+ context.fireContainerEvent("afterSessionDestroyed", listener);
} catch (Exception e) {
;
}
@@ -1330,39 +1299,33 @@
(HttpSessionAttributeListener) listeners[i];
try {
if (unbound != null) {
- fireContainerEvent(context,
- "beforeSessionAttributeReplaced",
+ context.fireContainerEvent("beforeSessionAttributeReplaced",
listener);
if (event == null) {
event = new HttpSessionBindingEvent
(getSession(), name, unbound);
}
listener.attributeReplaced(event);
- fireContainerEvent(context,
- "afterSessionAttributeReplaced",
+ context.fireContainerEvent("afterSessionAttributeReplaced",
listener);
} else {
- fireContainerEvent(context,
- "beforeSessionAttributeAdded",
+ context.fireContainerEvent("beforeSessionAttributeAdded",
listener);
if (event == null) {
event = new HttpSessionBindingEvent
(getSession(), name, value);
}
listener.attributeAdded(event);
- fireContainerEvent(context,
- "afterSessionAttributeAdded",
+ context.fireContainerEvent("afterSessionAttributeAdded",
listener);
}
} catch (Throwable t) {
try {
if (unbound != null) {
- fireContainerEvent(context,
- "afterSessionAttributeReplaced",
+ context.fireContainerEvent("afterSessionAttributeReplaced",
listener);
} else {
- fireContainerEvent(context,
- "afterSessionAttributeAdded",
+ context.fireContainerEvent("afterSessionAttributeAdded",
listener);
}
} catch (Exception e) {
@@ -1534,39 +1497,6 @@
/**
- * Fire container events if the Context implementation is the
- * <code>org.apache.catalina.core.StandardContext</code>.
- *
- * @param context Context for which to fire events
- * @param type Event type
- * @param data Event data
- *
- * @exception Exception occurred during event firing
- */
- protected void fireContainerEvent(Context context,
- String type, Object data)
- throws Exception {
-
- if (!"org.apache.catalina.core.StandardContext".equals
- (context.getClass().getName())) {
- return; // Container events are not supported
- }
- // NOTE: Race condition is harmless, so do not synchronize
- if (containerEventMethod == null) {
- containerEventMethod =
- context.getClass().getMethod("fireContainerEvent",
- containerEventTypes);
- }
- Object containerEventParams[] = new Object[2];
- containerEventParams[0] = type;
- containerEventParams[1] = data;
- containerEventMethod.invoke(context, containerEventParams);
-
- }
-
-
-
- /**
* Notify all session event listeners that a particular event has
* occurred for this Session. The default implementation performs
* this notification synchronously using the calling thread.
@@ -1646,21 +1576,18 @@
HttpSessionAttributeListener listener =
(HttpSessionAttributeListener) listeners[i];
try {
- fireContainerEvent(context,
- "beforeSessionAttributeRemoved",
+ context.fireContainerEvent("beforeSessionAttributeRemoved",
listener);
if (event == null) {
event = new HttpSessionBindingEvent
(getSession(), name, value);
}
listener.attributeRemoved(event);
- fireContainerEvent(context,
- "afterSessionAttributeRemoved",
+ context.fireContainerEvent("afterSessionAttributeRemoved",
listener);
} catch (Throwable t) {
try {
- fireContainerEvent(context,
- "afterSessionAttributeRemoved",
+ context.fireContainerEvent("afterSessionAttributeRemoved",
listener);
} catch (Exception e) {
;
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2009-06-02 14:12:44 UTC (rev 1073)
+++ trunk/webapps/docs/changelog.xml 2009-06-02 16:17:09 UTC (rev 1074)
@@ -93,6 +93,9 @@
<update>
Remove ServerFactory. (markt)
</update>
+ <fix>
+ <bug>47299</bug>: Expose Container.fireContainerEvent, which became public long ago. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
15 years, 6 months
JBossWeb SVN: r1073 - in trunk/java/org/apache/catalina: deploy and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-06-02 10:12:44 -0400 (Tue, 02 Jun 2009)
New Revision: 1073
Modified:
trunk/java/org/apache/catalina/core/StandardContext.java
trunk/java/org/apache/catalina/deploy/JspPropertyGroup.java
trunk/java/org/apache/catalina/startup/WebRuleSet.java
Log:
- Fix some jsp-property-group fields.
Modified: trunk/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContext.java 2009-05-28 15:28:37 UTC (rev 1072)
+++ trunk/java/org/apache/catalina/core/StandardContext.java 2009-06-02 14:12:44 UTC (rev 1073)
@@ -2284,8 +2284,12 @@
*/
public void addJspPropertyGroup(JspPropertyGroup propertyGroup) {
// Add any JSP mapping specified, as it needs to be mapped to the JSP Servlet
- addJspMapping(propertyGroup.getUrlPattern());
- jspPropertyGroups.put(propertyGroup.getUrlPattern(), propertyGroup);
+ String[] urlPatterns = propertyGroup.getUrlPatterns();
+ for (int i = 0; i < urlPatterns.length; i++) {
+ addJspMapping(urlPatterns[i]);
+ // Split off the groups to individual mappings
+ jspPropertyGroups.put(urlPatterns[i], propertyGroup);
+ }
}
Modified: trunk/java/org/apache/catalina/deploy/JspPropertyGroup.java
===================================================================
--- trunk/java/org/apache/catalina/deploy/JspPropertyGroup.java 2009-05-28 15:28:37 UTC (rev 1072)
+++ trunk/java/org/apache/catalina/deploy/JspPropertyGroup.java 2009-06-02 14:12:44 UTC (rev 1073)
@@ -23,27 +23,28 @@
package org.apache.catalina.deploy;
import java.io.Serializable;
+import java.util.ArrayList;
public class JspPropertyGroup implements Serializable {
- protected String urlPattern = null;
+ protected ArrayList<String> urlPatterns = new ArrayList<String>();
protected boolean elIgnored = false;
protected String pageEncoding = null;
protected boolean scriptingInvalid = false;
protected boolean isXml = false;
- protected String includePrelude = null;
- protected String includeCoda = null;
+ protected ArrayList<String> includePreludes = new ArrayList<String>();
+ protected ArrayList<String> includeCodas = new ArrayList<String>();
protected boolean deferredSyntaxAllowedAsLiteral = false;
protected boolean trimDirectiveWhitespaces = false;
protected String defaultContentType = null;
protected String buffer = null;
protected boolean errorOnUndeclaredNamespace = false;
- public String getUrlPattern() {
- return urlPattern;
+ public String[] getUrlPatterns() {
+ return urlPatterns.toArray(new String[0]);
}
- public void setUrlPattern(String urlPattern) {
- this.urlPattern = urlPattern;
+ public void addUrlPattern(String urlPattern) {
+ urlPatterns.add(urlPattern);
}
public boolean isElIgnored() {
return elIgnored;
@@ -69,17 +70,17 @@
public void setXml(boolean isXml) {
this.isXml = isXml;
}
- public String getIncludePrelude() {
- return includePrelude;
+ public String[] getIncludePreludes() {
+ return includePreludes.toArray(new String[0]);
}
- public void setIncludePrelude(String includePrelude) {
- this.includePrelude = includePrelude;
+ public void addIncludePrelude(String includePrelude) {
+ includePreludes.add(includePrelude);
}
- public String getIncludeCoda() {
- return includeCoda;
+ public String[] getIncludeCodas() {
+ return includeCodas.toArray(new String[0]);
}
- public void setIncludeCoda(String includeCoda) {
- this.includeCoda = includeCoda;
+ public void addIncludeCoda(String includeCoda) {
+ includeCodas.add(includeCoda);
}
public boolean isDeferredSyntaxAllowedAsLiteral() {
return deferredSyntaxAllowedAsLiteral;
Modified: trunk/java/org/apache/catalina/startup/WebRuleSet.java
===================================================================
--- trunk/java/org/apache/catalina/startup/WebRuleSet.java 2009-05-28 15:28:37 UTC (rev 1072)
+++ trunk/java/org/apache/catalina/startup/WebRuleSet.java 2009-06-02 14:12:44 UTC (rev 1073)
@@ -250,7 +250,7 @@
"addJspPropertyGroup", "org.apache.catalina.deploy.JspPropertyGroup");
digester.addCallMethod(prefix + elementName + "/jsp-config/jsp-property-group/url-pattern",
- "setUrlPattern", 0);
+ "addUrlPattern", 0);
digester.addCallMethod(prefix + elementName + "/jsp-config/jsp-property-group/el-ignored",
"setElIgnored", 0);
digester.addCallMethod(prefix + elementName + "/jsp-config/jsp-property-group/page-encoding",
@@ -260,9 +260,9 @@
digester.addCallMethod(prefix + elementName + "/jsp-config/jsp-property-group/is-xml",
"setIsXml", 0);
digester.addCallMethod(prefix + elementName + "/jsp-config/jsp-property-group/include-prelude",
- "setIncludePrelude", 0);
+ "addIncludePrelude", 0);
digester.addCallMethod(prefix + elementName + "/jsp-config/jsp-property-group/include-coda",
- "setIncludeCoda", 0);
+ "addIncludeCoda", 0);
digester.addCallMethod(prefix + elementName + "/jsp-config/jsp-property-group/deferred-syntax-allowed-as-literal",
"setDeferredSyntaxAllowedAsLiteral", 0);
digester.addCallMethod(prefix + elementName + "/jsp-config/jsp-property-group/trim-directive-whitespaces",
15 years, 6 months