JBossWeb SVN: r1145 - in trunk/java/org/apache/catalina: connector and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-08-18 10:06:05 -0400 (Tue, 18 Aug 2009)
New Revision: 1145
Modified:
trunk/java/org/apache/catalina/Context.java
trunk/java/org/apache/catalina/connector/Response.java
trunk/java/org/apache/catalina/core/ApplicationContext.java
trunk/java/org/apache/catalina/core/Constants.java
trunk/java/org/apache/catalina/core/StandardContext.java
Log:
- Implement 4 methods (two new and two that I forgot).
- Cleanup FIXMEs (restricted methods need to be done, basically).
Modified: trunk/java/org/apache/catalina/Context.java
===================================================================
--- trunk/java/org/apache/catalina/Context.java 2009-08-17 16:21:14 UTC (rev 1144)
+++ trunk/java/org/apache/catalina/Context.java 2009-08-18 14:06:05 UTC (rev 1145)
@@ -415,6 +415,18 @@
/**
+ * Return the Servlet API version defined for the webapp.
+ */
+ public int getVersionMajor();
+
+
+ /**
+ * Return the Servlet API version defined for the webapp.
+ */
+ public int getVersionMinor();
+
+
+ /**
* Set the Servlet API version defined for the webapp.
*
* @param version The version
Modified: trunk/java/org/apache/catalina/connector/Response.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Response.java 2009-08-17 16:21:14 UTC (rev 1144)
+++ trunk/java/org/apache/catalina/connector/Response.java 2009-08-18 14:06:05 UTC (rev 1145)
@@ -876,16 +876,13 @@
* a zero-length array if no headers have been set.
*/
public Collection<String> getHeaderNames() {
-
MimeHeaders headers = coyoteResponse.getMimeHeaders();
+ Collection<String> headersCollection = new ArrayList<String>();
int n = headers.size();
- String[] result = new String[n];
for (int i = 0; i < n; i++) {
- result[i] = headers.getName(i).toString();
+ headersCollection.add(headers.getName(i).toString());
}
- // FIXME
- return null;
-
+ return headersCollection;
}
@@ -914,8 +911,12 @@
* @param name Header name to look up
*/
public Collection<String> getHeaders(String name) {
- // FIXME
- return null;
+ Enumeration enumeration = coyoteResponse.getMimeHeaders().values(name);
+ Collection<String> headerValuesCollection = new ArrayList<String>();
+ while (enumeration.hasMoreElements()) {
+ headerValuesCollection.add((String) enumeration.nextElement());
+ }
+ return headerValuesCollection;
}
Modified: trunk/java/org/apache/catalina/core/ApplicationContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationContext.java 2009-08-17 16:21:14 UTC (rev 1144)
+++ trunk/java/org/apache/catalina/core/ApplicationContext.java 2009-08-18 14:06:05 UTC (rev 1145)
@@ -847,6 +847,7 @@
public FilterRegistration.Dynamic addFilter(String filterName, String className)
throws IllegalArgumentException, IllegalStateException {
+ // FIXME: restricted method
if (context.isInitialized()) {
throw new IllegalStateException(sm.getString("applicationContext.alreadyInitialized",
getContextPath()));
@@ -862,6 +863,7 @@
public FilterRegistration.Dynamic addFilter(String filterName, Filter filter) {
+ // FIXME: restricted method
if (context.isInitialized()) {
throw new IllegalStateException(sm.getString("applicationContext.alreadyInitialized",
getContextPath()));
@@ -879,12 +881,14 @@
public FilterRegistration.Dynamic addFilter(String filterName,
Class<? extends Filter> filterClass) {
+ // FIXME: restricted method
return addFilter(filterName, filterClass.getName());
}
public ServletRegistration.Dynamic addServlet(String servletName, String className)
throws IllegalArgumentException, IllegalStateException {
+ // FIXME: restricted method
if (context.isInitialized()) {
throw new IllegalStateException(sm.getString("applicationContext.alreadyInitialized",
getContextPath()));
@@ -901,11 +905,13 @@
public ServletRegistration.Dynamic addServlet(String servletName,
Class<? extends Servlet> clazz) throws IllegalArgumentException,
IllegalStateException {
+ // FIXME: restricted method
return addServlet(servletName, clazz.getName());
}
public ServletRegistration.Dynamic addServlet(String servletName, Servlet servlet) {
+ // FIXME: restricted method
if (context.isInitialized()) {
throw new IllegalStateException(sm.getString("applicationContext.alreadyInitialized",
getContextPath()));
@@ -921,6 +927,7 @@
public FilterRegistration getFilterRegistration(String filterName) {
+ // FIXME: restricted method
ApplicationFilterConfig filterConfig = context.findApplicationFilterConfig(filterName);
if (filterConfig == null) {
FilterDef filterDef = context.findFilterDef(filterName);
@@ -936,6 +943,7 @@
public ServletRegistration getServletRegistration(String servletName) {
+ // FIXME: restricted method
Wrapper wrapper = (Wrapper) context.findChild(servletName);
if (wrapper != null) {
return wrapper.getFacade();
@@ -946,6 +954,7 @@
public Map<String, FilterRegistration> getFilterRegistrations() {
+ // FIXME: restricted method
HashMap<String, FilterRegistration> result =
new HashMap<String, FilterRegistration>();
ApplicationFilterConfig[] filterConfigs = context.findApplicationFilterConfigs();
@@ -957,6 +966,7 @@
public Map<String, ServletRegistration> getServletRegistrations() {
+ // FIXME: restricted method
HashMap<String, ServletRegistration> result =
new HashMap<String, ServletRegistration>();
Container[] wrappers = context.findChildren();
@@ -968,34 +978,26 @@
}
- /**
- * By default {@link SessionTrackingMode#URL} is always supported, {@link
- * SessionTrackingMode#COOKIE} is supported unless the <code>cookies</code>
- * attribute has been set to <code>false</code> for the context and {@link
- * SessionTrackingMode#SSL} is supported if at least one of the connectors
- * used by this context has the attribute <code>secure</code> set to
- * <code>true</code>.
- */
public Set<SessionTrackingMode> getDefaultSessionTrackingModes() {
+ // FIXME: restricted method
return context.getDefaultSessionTrackingModes();
}
- /**
- * Return the supplied value if one was previously set, else return the
- * defaults.
- */
public Set<SessionTrackingMode> getEffectiveSessionTrackingModes() {
+ // FIXME: restricted method
return context.getSessionTrackingModes();
}
public SessionCookieConfig getSessionCookieConfig() {
+ // FIXME: restricted method
return context.getSessionCookie();
}
public <T extends Filter> T createFilter(Class<T> c)
throws ServletException {
+ // FIXME: restricted method
try {
return (T) context.getInstanceManager().newInstance(c);
} catch (Throwable e) {
@@ -1007,6 +1009,7 @@
public <T extends Servlet> T createServlet(Class<T> c)
throws ServletException {
+ // FIXME: restricted method
try {
return (T) context.getInstanceManager().newInstance(c);
} catch (Throwable e) {
@@ -1017,6 +1020,7 @@
public boolean setInitParameter(String name, String value) {
+ // FIXME: restricted method
mergeParameters();
if (parameters.get(name) != null) {
return false;
@@ -1035,13 +1039,12 @@
* requested
*/
public void setSessionTrackingModes(Set<SessionTrackingMode> sessionTrackingModes) {
-
+ // FIXME: restricted method
if (context.getAvailable()) {
throw new IllegalStateException(
sm.getString("applicationContext.setSessionTracking.ise",
getContextPath()));
}
-
// Check that only supported tracking modes have been requested
for (SessionTrackingMode sessionTrackingMode : sessionTrackingModes) {
if (!getDefaultSessionTrackingModes().contains(sessionTrackingMode)) {
@@ -1050,38 +1053,37 @@
sessionTrackingMode.toString(), getContextPath()));
}
}
- // TODO SERVLET3 - The SSL test
-
+ // TODO: Possible SSL tracking mode
context.setSessionTrackingModes(sessionTrackingModes);
}
public void addListener(String className) {
+ // FIXME: restricted method
if (context.isInitialized()) {
throw new IllegalStateException(sm.getString("applicationContext.alreadyInitialized",
getContextPath()));
}
- // FIXME: forbidden if the listener is from a TLD
context.addApplicationListener(className);
}
public <T extends EventListener> void addListener(T listener) {
+ // FIXME: restricted method
if (context.isInitialized()) {
throw new IllegalStateException(sm.getString("applicationContext.alreadyInitialized",
getContextPath()));
}
- // FIXME: forbidden if the listener is from a TLD
context.addApplicationListenerInstance(listener);
}
public void addListener(Class<? extends EventListener> listenerClass) {
+ // FIXME: restricted method
if (context.isInitialized()) {
throw new IllegalStateException(sm.getString("applicationContext.alreadyInitialized",
getContextPath()));
}
- // FIXME: forbidden if the listener is from a TLD
try {
EventListener listenerInstance =
(EventListener) context.getInstanceManager().newInstance(listenerClass);
@@ -1095,6 +1097,7 @@
public <T extends EventListener> T createListener(Class<T> clazz)
throws ServletException {
+ // FIXME: restricted method
if (context.isInitialized()) {
throw new IllegalStateException(sm.getString("applicationContext.alreadyInitialized",
getContextPath()));
@@ -1111,11 +1114,13 @@
public ClassLoader getClassLoader() {
+ // FIXME: restricted method
return context.getLoader().getClassLoader();
}
public JspConfigDescriptor getJspConfigDescriptor() {
+ // FIXME: restricted method
ArrayList<TaglibDescriptor> taglibDescriptors = new ArrayList<TaglibDescriptor>();
String[] taglibURIs = context.findTaglibs();
for (int i = 0; i < taglibURIs.length; i++) {
@@ -1135,14 +1140,14 @@
public int getEffectiveMajorVersion() {
- // TODO Auto-generated method stub
- return 0;
+ // FIXME: restricted method
+ return context.getVersionMajor();
}
public int getEffectiveMinorVersion() {
- // TODO Auto-generated method stub
- return 0;
+ // FIXME: restricted method
+ return context.getVersionMinor();
}
// -------------------------------------------------------- Package Methods
Modified: trunk/java/org/apache/catalina/core/Constants.java
===================================================================
--- trunk/java/org/apache/catalina/core/Constants.java 2009-08-17 16:21:14 UTC (rev 1144)
+++ trunk/java/org/apache/catalina/core/Constants.java 2009-08-18 14:06:05 UTC (rev 1145)
@@ -22,8 +22,8 @@
public class Constants {
public static final String Package = "org.apache.catalina.core";
- public static final int MAJOR_VERSION = 2;
- public static final int MINOR_VERSION = 5;
+ public static final int MAJOR_VERSION = 3;
+ public static final int MINOR_VERSION = 0;
public static final String JSP_SERVLET_CLASS =
"org.apache.jasper.servlet.JspServlet";
Modified: trunk/java/org/apache/catalina/core/StandardContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContext.java 2009-08-17 16:21:14 UTC (rev 1144)
+++ trunk/java/org/apache/catalina/core/StandardContext.java 2009-08-18 14:06:05 UTC (rev 1145)
@@ -519,6 +519,18 @@
/**
+ * Version number.
+ */
+ protected int versionMinor = 0;
+
+
+ /**
+ * Version number.
+ */
+ protected int versionMajor = 0;
+
+
+ /**
* The reloadable flag for this web application.
*/
protected boolean reloadable = false;
@@ -1604,6 +1616,34 @@
/**
+ * Return the Servlet API version defined for the webapp.
+ */
+ public int getVersionMajor() {
+ if (version != null) {
+ int pos = version.indexOf('.');
+ if (pos != -1) {
+ versionMajor = Integer.parseInt(version.substring(0, pos));
+ }
+ }
+ return versionMajor;
+ }
+
+
+ /**
+ * Return the Servlet API version defined for the webapp.
+ */
+ public int getVersionMinor() {
+ if (version != null) {
+ int pos = version.indexOf('.');
+ if (pos < version.length()) {
+ versionMinor = Integer.parseInt(version.substring(pos + 1));
+ }
+ }
+ return versionMinor;
+ }
+
+
+ /**
* Set the Servlet API version defined for the webapp.
*
* @param version The version
@@ -1611,6 +1651,8 @@
public void setVersion(String version) {
String oldVersion = this.version;
this.version = version;
+ getVersionMajor();
+ getVersionMinor();
support.firePropertyChange("version", oldVersion, version);
}
15 years, 4 months
JBossWeb SVN: r1144 - in trunk/java: javax/servlet/descriptor and 4 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-08-17 12:21:14 -0400 (Mon, 17 Aug 2009)
New Revision: 1144
Modified:
trunk/java/javax/servlet/AsyncContext.java
trunk/java/javax/servlet/FilterRegistration.java
trunk/java/javax/servlet/GenericServlet.java
trunk/java/javax/servlet/Registration.java
trunk/java/javax/servlet/ServletConfig.java
trunk/java/javax/servlet/ServletContainerInitializer.java
trunk/java/javax/servlet/ServletContext.java
trunk/java/javax/servlet/ServletRegistration.java
trunk/java/javax/servlet/ServletRequest.java
trunk/java/javax/servlet/SessionCookieConfig.java
trunk/java/javax/servlet/descriptor/JspConfigDescriptor.java
trunk/java/javax/servlet/descriptor/JspPropertyGroupDescriptor.java
trunk/java/javax/servlet/http/HttpServletRequest.java
trunk/java/javax/servlet/http/HttpServletRequestWrapper.java
trunk/java/javax/servlet/http/HttpServletResponse.java
trunk/java/javax/servlet/http/HttpServletResponseWrapper.java
trunk/java/javax/servlet/http/Part.java
trunk/java/org/apache/catalina/connector/Request.java
trunk/java/org/apache/catalina/connector/RequestFacade.java
trunk/java/org/apache/catalina/connector/Response.java
trunk/java/org/apache/catalina/connector/ResponseFacade.java
trunk/java/org/apache/catalina/core/ApplicationContext.java
trunk/java/org/apache/catalina/core/ApplicationContextFacade.java
trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java
trunk/java/org/apache/catalina/core/ApplicationFilterConfigFacade.java
trunk/java/org/apache/catalina/core/DummyRequest.java
trunk/java/org/apache/catalina/core/DummyResponse.java
trunk/java/org/apache/catalina/core/StandardWrapperFacade.java
trunk/java/org/apache/tomcat/util/http/fileupload/DefaultFileItem.java
Log:
- Update to current Servlet 3.0 API.
- Some fixmes for the version stuff (whatever ...) and the collection header queries are not done either.
Modified: trunk/java/javax/servlet/AsyncContext.java
===================================================================
--- trunk/java/javax/servlet/AsyncContext.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/AsyncContext.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -107,11 +107,8 @@
/**
- * Checks if this AsyncContext was initialized with the original
- * request and response objects by calling
- * {@link ServletRequest#startAsync()}, or if it was initialized
- * with wrapped request and/or response objects using
- * {@link ServletRequest#startAsync(ServletRequest, ServletResponse)}.
+ * Checks if this AsyncContext was initialized with the original or
+ * application-wrapped request and response objects.
*
* <p>This information may be used by filters invoked in the
* <i>outbound</i> direction, after a request was put into
@@ -122,9 +119,11 @@
*
* @return true if this AsyncContext was initialized with the original
* request and response objects by calling
- * {@link ServletRequest#startAsync()}, and false if it was initialized
- * with wrapped request and/or response objects using
- * {@link ServletRequest#startAsync(ServletRequest, ServletResponse)}.
+ * {@link ServletRequest#startAsync()}, or if it was initialized by
+ * calling
+ * {@link ServletRequest#startAsync(ServletRequest, ServletResponse)},
+ * and neither the ServletRequest nor ServletResponse arguments
+ * carried any application-provided wrappers; false otherwise
*/
public boolean hasOriginalRequestAndResponse();
Modified: trunk/java/javax/servlet/FilterRegistration.java
===================================================================
--- trunk/java/javax/servlet/FilterRegistration.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/FilterRegistration.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -36,8 +36,7 @@
package javax.servlet;
-import java.util.EnumSet;
-import java.util.Set;
+import java.util.*;
/**
* Interface through which a {@link Filter} may be further configured.
@@ -76,13 +75,17 @@
String... servletNames);
/**
- * Gets an Iterable over the currently available servlet name mappings
- * of the Filter represented by this FilterRegistration.
+ * Gets the currently available servlet name mappings
+ * of the Filter represented by this <code>FilterRegistration</code>.
*
- * @return Iterable over the currently available servlet name
- * mappings of the Filter represented by this FilterRegistration.
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>FilterRegistration</code>.
+ *
+ * @return a (possibly empty) <code>Collection</code> of the currently
+ * available servlet name mappings of the Filter represented by this
+ * <code>FilterRegistration</code>
*/
- public Iterable<String> getServletNameMappings();
+ public Collection<String> getServletNameMappings();
/**
* Adds a filter mapping with the given url patterns and dispatcher
@@ -114,13 +117,17 @@
String... urlPatterns);
/**
- * Gets an Iterable over the currently available URL pattern mappings
- * of the Filter represented by this FilterRegistration.
+ * Gets the currently available URL pattern mappings of the Filter
+ * represented by this <code>FilterRegistration</code>.
*
- * @return Iterable over the currently available URL pattern
- * mappings of the Filter represented by this FilterRegistration.
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>FilterRegistration</code>.
+ *
+ * @return a (possibly empty) <code>Collection</code> of the currently
+ * available URL pattern mappings of the Filter represented by this
+ * <code>FilterRegistration</code>
*/
- public Iterable<String> getUrlPatternMappings();
+ public Collection<String> getUrlPatternMappings();
/**
* Interface through which a {@link Filter} registered via one of the
Modified: trunk/java/javax/servlet/GenericServlet.java
===================================================================
--- trunk/java/javax/servlet/GenericServlet.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/GenericServlet.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -58,7 +58,6 @@
import java.io.IOException;
import java.util.Enumeration;
-import java.util.Iterator;
import java.util.ResourceBundle;
/**
Modified: trunk/java/javax/servlet/Registration.java
===================================================================
--- trunk/java/javax/servlet/Registration.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/Registration.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -143,19 +143,6 @@
interface Dynamic extends Registration {
/**
- * Sets the description on the Servlet or Filter represented by
- * this dynamic Registration.
- *
- * <p>A call to this method overrides any previous setting.
- *
- * @param description the description of the servlet
- *
- * @throws IllegalStateException if the ServletContext from which
- * this dynamic Registration was obtained has already been initialized
- */
- public void setDescription(String description);
-
- /**
* Configures the Servlet or Filter represented by this dynamic
* Registration as supporting asynchronous operations or not.
*
Modified: trunk/java/javax/servlet/ServletConfig.java
===================================================================
--- trunk/java/javax/servlet/ServletConfig.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/ServletConfig.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -55,7 +55,6 @@
package javax.servlet;
import java.util.Enumeration;
-import java.util.Iterator;
/**
* A servlet configuration object used by a servlet container
Modified: trunk/java/javax/servlet/ServletContainerInitializer.java
===================================================================
--- trunk/java/javax/servlet/ServletContainerInitializer.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/ServletContainerInitializer.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -81,6 +81,9 @@
*
* @param ctx The <tt>ServletContext</tt> instance in which the types
* defined via the <tt>HandlesTypes</tt> annotation were found.
+ *
+ * @throws ServletException if an error has occurred
*/
- public void onStartup(Set<Class<?>> c, ServletContext ctx);
+ public void onStartup(Set<Class<?>> c, ServletContext ctx)
+ throws ServletException;
}
Modified: trunk/java/javax/servlet/ServletContext.java
===================================================================
--- trunk/java/javax/servlet/ServletContext.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/ServletContext.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -168,7 +168,7 @@
/**
- * Returns the major version of the Java Servlet API that this
+ * Returns the major version of the Servlet API that this
* servlet container supports. All implementations that comply
* with Version 3.0 must have this method return the integer 3.
*
@@ -188,6 +188,50 @@
/**
+ * Gets the major version of the Servlet specification that the
+ * application represented by this ServletContext is based on.
+ *
+ * <p>The value returned may be different from {@link #getMajorVersion},
+ * which returns the major version of the Servlet specification
+ * supported by the Servlet container.
+ *
+ * @return the major version of the Servlet specification that the
+ * application represented by this ServletContext is based on
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
+ * with {@link javax.servlet.annotation.WebListener}
+ *
+ * @since Servlet 3.0
+ */
+ public int getEffectiveMajorVersion();
+
+
+ /**
+ * Gets the minor version of the Servlet specification that the
+ * application represented by this ServletContext is based on.
+ *
+ * <p>The value returned may be different from {@link #getMinorVersion},
+ * which returns the minor version of the Servlet specification
+ * supported by the Servlet container.
+ *
+ * @return the minor version of the Servlet specification that the
+ * application xrepresented by this ServletContext is based on
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
+ * with {@link javax.servlet.annotation.WebListener}
+ *
+ * @since Servlet 3.0
+ */
+ public int getEffectiveMinorVersion();
+
+
+ /**
* Returns the MIME type of the specified file, or <code>null</code> if
* the MIME type is not known. The MIME type is determined
* by the configuration of the servlet container, and may be specified
@@ -576,10 +620,12 @@
* context initialization parameter with a matching name
*
* @throws IllegalStateException if this ServletContext has already
- * been initialized, or if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or annotated
+ * been initialized
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -705,10 +751,12 @@
* ServletContext already contains a servlet with a matching name
*
* @throws IllegalStateException if this ServletContext has already
- * been initialized, or if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or annotated
+ * been initialized
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -735,10 +783,12 @@
* container
*
* @throws IllegalStateException if this ServletContext has already
- * been initialized, or if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or annotated
+ * been initialized
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @throws IllegalArgumentException if the given servlet instance
@@ -766,10 +816,12 @@
* ServletContext already contains a servlet with a matching name
*
* @throws IllegalStateException if this ServletContext has already
- * been initialized, or if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or annotated
+ * been initialized
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -794,10 +846,10 @@
* @throws ServletException if an error occurs during the instantiation
* of, or resource injection into the new Servlet
*
- * @throws IllegalStateException if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or annotated
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -813,10 +865,10 @@
* given <tt>servletName</tt>, or null if no ServletRegistration exists
* under that name in this ServletContext
*
- * @throws IllegalStateException if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or annotated
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -825,7 +877,7 @@
/**
- * Gets an immutable (and possibly empty) Map of the ServletRegistration
+ * Gets a (possibly empty) Map of the ServletRegistration
* objects (keyed by servlet name) corresponding to all servlets
* registered with this ServletContext.
*
@@ -834,18 +886,21 @@
* ServletRegistration objects corresponding to all servlets that have
* been added via one of the <tt>addServlet</tt> methods.
*
+ * <p>Any changes to the returned Map must not affect this
+ * ServletContext.
+ *
* @return Map of the ServletRegistration objects corresponding
* to all servlets currently registered with this ServletContext
*
- * @throws IllegalStateException if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or annotated
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
*/
- public Map<String, ServletRegistration> getServletRegistrations();
+ public Map<String, ? extends ServletRegistration> getServletRegistrations();
/**
@@ -867,10 +922,12 @@
* ServletContext already contains a filter with a matching name
*
* @throws IllegalStateException if this ServletContext has already
- * been initialized, or if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or annotated
+ * been initialized
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -897,10 +954,12 @@
* container
*
* @throws IllegalStateException if this ServletContext has already
- * been initialized, or if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or annotated
+ * been initialized
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -925,10 +984,12 @@
* ServletContext already contains a filter with a matching name
*
* @throws IllegalStateException if this ServletContext has already
- * been initialized, or if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or annotated
+ * been initialized
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -953,10 +1014,10 @@
* @throws ServletException if an error occurs during the instantiation
* of, or resource injection into the new Filter
*
- * @throws IllegalStateException if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or annotated
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -973,10 +1034,10 @@
* given <tt>filterName</tt>, or null if no FilterRegistration exists
* under that name in this ServletContext
*
- * @throws IllegalStateException if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or annotated
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -985,7 +1046,7 @@
/**
- * Gets an immutable (and possibly empty) Map of the FilterRegistration
+ * Gets a (possibly empty) Map of the FilterRegistration
* objects (keyed by filter name) corresponding to all filters
* registered with this ServletContext.
*
@@ -994,18 +1055,21 @@
* FilterRegistration objects corresponding to all filters that have
* been added via one of the <tt>addFilter</tt> methods.
*
+ * <p>Any changes to the returned Map must not affect this
+ * ServletContext.
+ *
* @return Map of the FilterRegistration objects corresponding
* to all filters currently registered with this ServletContext
*
- * @throws IllegalStateException if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or annotated
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
*/
- public Map<String, FilterRegistration> getFilterRegistrations();
+ public Map<String, ? extends FilterRegistration> getFilterRegistrations();
/**
@@ -1020,10 +1084,10 @@
* various properties of the session tracking cookies created on
* behalf of this <tt>ServletContext</tt> may be configured
*
- * @throws IllegalStateException if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or annotated
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -1043,10 +1107,12 @@
* become effective for this <tt>ServletContext</tt>
*
* @throws IllegalStateException if this ServletContext has already
- * been initialized, or if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or annotated
+ * been initialized
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @throws IllegalArgumentException if <tt>sessionTrackingModes</tt>
@@ -1067,10 +1133,10 @@
* @return set of the session tracking modes supported by default for
* this <tt>ServletContext</tt>
*
- * @throws IllegalStateException if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or annotated
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -1092,10 +1158,10 @@
* @return set of the session tracking modes in effect for this
* <tt>ServletContext</tt>
*
- * @throws IllegalStateException if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or annotated
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -1143,10 +1209,12 @@
* passed to {@link ServletContainerInitializer#onStartup}
*
* @throws IllegalStateException if this ServletContext has already
- * been initialized, or if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or annotated
+ * been initialized
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -1188,10 +1256,12 @@
* passed to {@link ServletContainerInitializer#onStartup}
*
* @throws IllegalStateException if this ServletContext has already
- * been initialized, or if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or annotated
+ * been initialized
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -1234,10 +1304,12 @@
* to {@link ServletContainerInitializer#onStartup}
*
* @throws IllegalStateException if this ServletContext has already
- * been initialized, or if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or annotated
+ * been initialized
+ *
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @since Servlet 3.0
@@ -1270,10 +1342,10 @@
* @throws ServletException if an error occurs during the instantiation
* of, or resource injection into the new EventListener
*
- * @throws IllegalStateException if this ServletContext was passed to the
- * {@link ServletContextListener#contextInitialized} method of a
- * {@link ServletContextListener} that was not declared in
- * <code>web.xml</code> or <code>web-fragment.xml</code>, or annotated
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
* with {@link javax.servlet.annotation.WebListener}
*
* @throws IllegalArgumentException if the specified EventListener class
@@ -1304,6 +1376,12 @@
* represented by this ServletContext, or null if no such configuration
* exists
*
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
+ * with {@link javax.servlet.annotation.WebListener}
+ *
* @see javax.servlet.descriptor.JspConfigDescriptor
*
* @since Servlet 3.0
@@ -1312,12 +1390,28 @@
/**
- * Gets the classloader of the web application represented by this
+ * Gets the class loader of the web application represented by this
* ServletContext.
*
- * @return the classloader of the web application represented by this
+ * <p>If a security manager exists, and the caller's class loader
+ * is not the same as, or an ancestor of the requested class loader,
+ * then the security manager's <code>checkPermission</code> method is
+ * called with a <code>RuntimePermission("getClassLoader")</code>
+ * permission to check whether access to the requested class loader
+ * should be granted.
+ *
+ * @return the class loader of the web application represented by this
* ServletContext
*
+ * @throws UnsupportedOperationException if this ServletContext was
+ * passed to the {@link ServletContextListener#contextInitialized} method
+ * of a {@link ServletContextListener} that was neither declared in
+ * <code>web.xml</code> or <code>web-fragment.xml</code>, nor annotated
+ * with {@link javax.servlet.annotation.WebListener}
+ *
+ * @throws SecurityException if a security manager denies access to
+ * the requested class loader
+ *
* @since Servlet 3.0
*/
public ClassLoader getClassLoader();
Modified: trunk/java/javax/servlet/ServletRegistration.java
===================================================================
--- trunk/java/javax/servlet/ServletRegistration.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/ServletRegistration.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -65,13 +65,17 @@
public Set<String> addMapping(String... urlPatterns);
/**
- * Gets an Iterable over the currently available mappings of the
- * Servlet represented by this ServletRegistration.
+ * Gets the currently available mappings of the
+ * Servlet represented by this <code>ServletRegistration</code>.
*
- * @return Iterable over the currently available mappings
- * of the Servlet represented by this ServletRegistration.
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>ServletRegistration</code>.
+ *
+ * @return a (possibly empty) <code>Collection</code> of the currently
+ * available mappings of the Servlet represented by this
+ * <code>ServletRegistration</code>
*/
- public Iterable<String> getMappings();
+ public Collection<String> getMappings();
/**
* Interface through which a {@link Servlet} registered via one of the
Modified: trunk/java/javax/servlet/ServletRequest.java
===================================================================
--- trunk/java/javax/servlet/ServletRequest.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/ServletRequest.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -683,9 +683,9 @@
* {@link AsyncContext#complete}.
*
* <p>Calling {@link AsyncContext#hasOriginalRequestAndResponse()} on
- * the returned AsyncContext will return <code>false</code>
- * (unless the passed in ServletRequest and ServletResponse arguments
- * are the original ones).
+ * the returned AsyncContext will return <code>false</code>,
+ * unless the passed in ServletRequest and ServletResponse arguments
+ * are the original ones or do not carry any application-provided wrappers.
* Any filters invoked in the <i>outbound</i> direction after this
* request was put into asynchronous mode may use this as an indication
* that some of the request and/or response wrappers that they added
Modified: trunk/java/javax/servlet/SessionCookieConfig.java
===================================================================
--- trunk/java/javax/servlet/SessionCookieConfig.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/SessionCookieConfig.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -272,6 +272,10 @@
* cookies created on behalf of the <tt>ServletContext</tt> from which
* this <tt>SessionCookieConfig</tt> was acquired.
*
+ * @throws IllegalStateException if the <tt>ServletContext</tt>
+ * from which this <tt>SessionCookieConfig</tt> was acquired has
+ * already been initialized
+ *
* @see javax.servlet.http.Cookie#setMaxAge
*/
public void setMaxAge(int maxAge);
Modified: trunk/java/javax/servlet/descriptor/JspConfigDescriptor.java
===================================================================
--- trunk/java/javax/servlet/descriptor/JspConfigDescriptor.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/descriptor/JspConfigDescriptor.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -36,6 +36,8 @@
package javax.servlet.descriptor;
+import java.util.Collection;
+
/**
* This interface provides access to the <code><jsp-config></code>
* related configuration of a web application.
@@ -48,22 +50,32 @@
public interface JspConfigDescriptor {
/**
- * Gets an <code>Iterable</code> over the <code><taglib></code>
- * elements that are nested inside the <code><jsp-config></code>.
+ * Gets the <code><taglib></code> child elements of the
+ * <code><jsp-config></code> element represented by this
+ * <code>JspConfigDescriptor</code>.
*
- * @return <code>Iterable</code> over the <code>taglib</code>
- * elements that are nested inside the <code>jsp-config</code>
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>JspConfigDescriptor</code>.
+ *
+ * @return a (possibly empty) <code>Collection</code> of the
+ * <code><taglib<>/code> child elements of the
+ * <code><jsp-config></code> element represented by this
+ * <code>JspConfigDescriptor</code>
*/
- public Iterable<TaglibDescriptor> getTaglibs();
+ public Collection<TaglibDescriptor> getTaglibs();
/**
- * Gets an <code>Iterable</code> over the
- * <code><jsp-property-group></code> elements that are nested
- * inside the <code><jsp-config></code>.
+ * Gets the <code><jsp-property-group></code> child elements
+ * of the <code><jsp-config></code> element represented by this
+ * <code>JspConfigDescriptor</code>.
*
- * @return <code>Iterable</code> over the
- * <code><jsp-property-group></code>
- * elements that are nested inside the <code><jsp-config></code>
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>JspConfigDescriptor</code>.
+ *
+ * @return a (possibly empty) <code>Collection</code> of the
+ * <code><jsp-property-group></code> child elements of the
+ * <code><jsp-config></code> element represented by this
+ * <code>JspConfigDescriptor</code>
*/
- public Iterable<JspPropertyGroupDescriptor> getJspPropertyGroups();
+ public Collection<JspPropertyGroupDescriptor> getJspPropertyGroups();
}
Modified: trunk/java/javax/servlet/descriptor/JspPropertyGroupDescriptor.java
===================================================================
--- trunk/java/javax/servlet/descriptor/JspPropertyGroupDescriptor.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/descriptor/JspPropertyGroupDescriptor.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -36,6 +36,8 @@
package javax.servlet.descriptor;
+import java.util.Collection;
+
/**
* This interface provides access to the
* <code><jsp-property-group></code>
@@ -50,18 +52,22 @@
/**
* Gets the URL patterns of the JSP property group represented by this
- * JspPropertyGroupDescriptor.
+ * <code>JspPropertyGroupDescriptor</code>.
*
- * @return Iterable over the URL patterns of the JSP property group
- * represented by this JspPropertyGroupDescriptor
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>JspPropertyGroupDescriptor</code>.
+ *
+ * @return a (possibly empty) <code>Collection</code> of the URL
+ * patterns of the JSP property group represented by this
+ * <code>JspPropertyGroupDescriptor</code>
*/
- public Iterable<String> getUrlPatterns();
+ public Collection<String> getUrlPatterns();
/**
* Gets the value of the <code>el-ignored</code> configuration, which
* specifies whether Expression Language (EL) evaluation is enabled for
* any JSP pages mapped to the JSP property group represented by this
- * JspPropertyGroupDescriptor.
+ * <code>JspPropertyGroupDescriptor</code>.
*
* @return the value of the <code>el-ignored</code> configuration, or
* null if unspecified
@@ -72,7 +78,7 @@
* Gets the value of the <code>page-encoding</code> configuration,
* which specifies the default page encoding for any JSP pages mapped
* to the JSP property group represented by this
- * JspPropertyGroupDescriptor.
+ * <code>JspPropertyGroupDescriptor</code>.
*
* @return the value of the <code>page-encoding</code> configuration, or
* null if unspecified
@@ -83,7 +89,7 @@
* Gets the value of the <code>scripting-invalid</code> configuration,
* which specifies whether scripting is enabled for any JSP pages mapped
* to the JSP property group represented by this
- * JspPropertyGroupDescriptor.
+ * <code>JspPropertyGroupDescriptor</code>.
*
* @return the value of the <code>scripting-invalid</code> configuration,
* or null if unspecified
@@ -93,8 +99,8 @@
/**
* Gets the value of the <code>is-xml</code> configuration, which
* specifies whether any JSP pages mapped to the JSP property group
- * represented by this JspPropertyGroupDescriptor should be treated
- * as JSP documents (XML syntax).
+ * represented by this <code>JspPropertyGroupDescriptor</code> will
+ * be treated as JSP documents (XML syntax).
*
* @return the value of the <code>is-xml</code> configuration, or
* null if unspecified
@@ -102,24 +108,34 @@
public String getIsXml();
/**
- * Gets an Iterable over the <code>include-prelude</code> configuration
+ * Gets the <code>include-prelude</code> configuration
* of the JSP property group represented by this
- * JspPropertyGroupDescriptor.
+ * <code>JspPropertyGroupDescriptor</code>.
*
- * @return Iterable over the <code>include-prelude</code> configuration of
- * the JSP property group represented by this JspPropertyGroupDescriptor
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>JspPropertyGroupDescriptor</code>.
+ *
+ * @return a (possibly empty) <code>Collection</code> of the
+ * <code>include-prelude</code> configuration of
+ * the JSP property group represented by this
+ * <code>JspPropertyGroupDescriptor</code>
*/
- public Iterable<String> getIncludePreludes();
+ public Collection<String> getIncludePreludes();
/**
- * Gets an Iterable over the <code>include-coda</code> configuration
+ * Gets the <code>include-coda</code> configuration
* of the JSP property group represented by this
- * JspPropertyGroupDescriptor.
+ * <code>JspPropertyGroupDescriptor</code>.
*
- * @return Iterable over the <code>include-coda</code> configuration of
- * the JSP property group represented by this JspPropertyGroupDescriptor
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>JspPropertyGroupDescriptor</code>.
+ *
+ * @return a (possibly empty) <code>Collection</code> of the
+ * <code>include-coda</code> configuration of
+ * the JSP property group represented by this
+ * <code>JspPropertyGroupDescriptor</code>
*/
- public Iterable<String> getIncludeCodas();
+ public Collection<String> getIncludeCodas();
/**
* Gets the value of the
@@ -128,7 +144,7 @@
* which is normally reserved for Expression Language (EL) expressions,
* will cause a translation error if it appears as a String literal
* in any JSP pages mapped to the JSP property group represented by
- * this JspPropertyGroupDescriptor.
+ * this <code>JspPropertyGroupDescriptor</code>.
*
* @return the value of the
* <code>deferred-syntax-allowed-as-literal</code> configuration, or
@@ -141,7 +157,7 @@
* configuration, which specifies whether template text containing only
* whitespaces must be removed from the response output of any JSP
* pages mapped to the JSP property group represented by this
- * JspPropertyGroupDescriptor.
+ * <code>JspPropertyGroupDescriptor</code>.
*
* @return the value of the <code>trim-directive-whitespaces</code>
* configuration, or null if unspecified
@@ -152,7 +168,7 @@
* Gets the value of the <code>default-content-type</code> configuration,
* which specifies the default response content type for any JSP pages
* mapped to the JSP property group represented by this
- * JspPropertyGroupDescriptor.
+ * <code>JspPropertyGroupDescriptor</code>.
*
* @return the value of the <code>default-content-type</code>
* configuration, or null if unspecified
@@ -163,7 +179,7 @@
* Gets the value of the <code>buffer</code> configuration, which
* specifies the default size of the response buffer for any JSP pages
* mapped to the JSP property group represented by this
- * JspPropertyGroupDescriptor.
+ * <code>JspPropertyGroupDescriptor</code>.
*
* @return the value of the <code>buffer</code> configuration, or
* null if unspecified
@@ -175,7 +191,7 @@
* configuration, which specifies whether an error will be raised at
* translation time if tag with an undeclared namespace is used in
* any JSP pages mapped to the JSP property group represented by this
- * JspPropertyGroupDescriptor.
+ * <code>JspPropertyGroupDescriptor</code>.
*
* @return the value of the <code>error-on-undeclared-namespace</code>
* configuration, or null if unspecified
Modified: trunk/java/javax/servlet/http/HttpServletRequest.java
===================================================================
--- trunk/java/javax/servlet/http/HttpServletRequest.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/http/HttpServletRequest.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -55,9 +55,9 @@
package javax.servlet.http;
import java.io.IOException;
+import java.util.*;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
-import java.util.Enumeration;
/**
*
@@ -803,15 +803,20 @@
*
* <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.
+ * <tt>Collection</tt> will be empty.
*
- * @return A (possibly empty) <code>Iterable</code> over all the
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>HttpServletRequest</code>.
+ *
+ * @return a (possibly empty) <code>Collection</code> of the
* Part components of this request
*
* @throws IOException if an I/O error occurred during the retrieval
* of the {@link 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>
@@ -821,7 +826,7 @@
*
* @since Servlet 3.0
*/
- public Iterable<Part> getParts() throws IOException, ServletException;
+ public Collection<Part> getParts() throws IOException, ServletException;
/**
Modified: trunk/java/javax/servlet/http/HttpServletRequestWrapper.java
===================================================================
--- trunk/java/javax/servlet/http/HttpServletRequestWrapper.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/http/HttpServletRequestWrapper.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -55,9 +55,9 @@
package javax.servlet.http;
import java.io.IOException;
+import java.util.*;
import javax.servlet.ServletException;
import javax.servlet.ServletRequestWrapper;
-import java.util.Enumeration;
/**
* Provides a convenient implementation of the HttpServletRequest interface
@@ -338,9 +338,12 @@
* The default behavior of this method is to call getParts on the wrapped
* request object.
*
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>HttpServletRequestWrapper</code>.
+ *
* @since Servlet 3.0
*/
- public Iterable<Part> getParts() throws IOException, ServletException {
+ public Collection<Part> getParts() throws IOException, ServletException {
return this._getHttpServletRequest().getParts();
}
Modified: trunk/java/javax/servlet/http/HttpServletResponse.java
===================================================================
--- trunk/java/javax/servlet/http/HttpServletResponse.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/http/HttpServletResponse.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -57,7 +57,7 @@
package javax.servlet.http;
import java.io.IOException;
-
+import java.util.Collection;
import javax.servlet.ServletResponse;
/**
@@ -393,40 +393,43 @@
/**
- * Gets the values of the response header with the given name
- * as an <tt>Iterable</tt> of <tt>String</tt> objects.
+ * Gets the values of the response header with the given name.
*
* <p>This method considers only response headers set or added via
* {@link #setHeader}, {@link #addHeader}, {@link #setDateHeader},
* {@link #addDateHeader}, {@link #setIntHeader}, or
* {@link #addIntHeader}, respectively.
*
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>HttpServletResponse</code>.
+ *
* @param name the name of the response header whose values to return
*
- * @return the values of the response header with the given name,
- * or an empty <tt>Iterable</tt> if no header with the given name
- * has been set on this response
+ * @return a (possibly empty) <code>Collection</code> of the values
+ * of the response header with the given name
*
* @since Servlet 3.0
*/
- public Iterable<String> getHeaders(String name);
+ public Collection<String> getHeaders(String name);
/**
- * Gets the names of the headers of this response
- * as an <tt>Iterable</tt> of <tt>String</tt> objects.
+ * Gets the names of the headers of this response.
*
* <p>This method considers only response headers set or added via
* {@link #setHeader}, {@link #addHeader}, {@link #setDateHeader},
* {@link #addDateHeader}, {@link #setIntHeader}, or
* {@link #addIntHeader}, respectively.
*
- * @return the names of the headers of this response, or an empty
- * <tt>Iterable</tt> if no headers have been set on this response
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>HttpServletResponse</code>.
*
+ * @return a (possibly empty) <code>Collection</code> of the names
+ * of the headers of this response
+ *
* @since Servlet 3.0
*/
- public Iterable<String> getHeaderNames();
+ public Collection<String> getHeaderNames();
/*
Modified: trunk/java/javax/servlet/http/HttpServletResponseWrapper.java
===================================================================
--- trunk/java/javax/servlet/http/HttpServletResponseWrapper.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/http/HttpServletResponseWrapper.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -57,7 +57,7 @@
package javax.servlet.http;
import java.io.IOException;
-
+import java.util.Collection;
import javax.servlet.ServletResponseWrapper;
/**
@@ -262,6 +262,8 @@
* @return the value of the response header with the given name,
* or <tt>null</tt> if no header with the given name has been set
* on the wrapped response
+ *
+ * @since Servlet 3.0
*/
public String getHeader(String name) {
return _getHttpServletResponse().getHeader(name);
@@ -273,13 +275,17 @@
* {@link HttpServletResponse#getHeaders} on the wrapped response
* object.
*
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>HttpServletResponseWrapper</code>.
+ *
* @param name the name of the response header whose values to return
*
- * @return the values of the response header with the given name,
- * or an empty <tt>Iterable</tt> if no header with the given name
- * has been set on the wrapped response
+ * @return a (possibly empty) <code>Collection</code> of the values
+ * of the response header with the given name
+ *
+ * @since Servlet 3.0
*/
- public Iterable<String> getHeaders(String name) {
+ public Collection<String> getHeaders(String name) {
return _getHttpServletResponse().getHeaders(name);
}
@@ -289,11 +295,15 @@
* {@link HttpServletResponse#getHeaderNames} on the wrapped response
* object.
*
- * @return the names of the headers of the wrapped response, or an empty
- * <tt>Iterable</tt> if no headers have been set on the wrapped
- * response
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>HttpServletResponseWrapper</code>.
+ *
+ * @return a (possibly empty) <code>Collection</code> of the names
+ * of the response headers
+ *
+ * @since Servlet 3.0
*/
- public Iterable<String> getHeaderNames() {
+ public Collection<String> getHeaderNames() {
return _getHttpServletResponse().getHeaderNames();
}
Modified: trunk/java/javax/servlet/http/Part.java
===================================================================
--- trunk/java/javax/servlet/http/Part.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/javax/servlet/http/Part.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -36,10 +36,9 @@
package javax.servlet.http;
-import java.io.InputStream;
-import java.io.IOException;
+import java.io.*;
+import java.util.*;
-
/**
* <p> This class represents a part or form item that was received within a
* <code>multipart/form-data</code> POST request.
@@ -64,7 +63,6 @@
*/
public String getContentType();
-
/**
* Gets the name of this part
*
@@ -72,8 +70,6 @@
*/
public String getName();
-
-
/**
* Returns the size of this fille.
*
@@ -81,23 +77,22 @@
*/
public long getSize();
-
/**
* A convenience method to write this uploaded item to disk.
- * <p>
- * This method is not guaranteed to succeed if called more than once for
+ *
+ * <p>This method is not guaranteed to succeed if called more than once for
* the same part. This allows a particular implementation to use, for
* example, file renaming, where possible, rather than copying all of the
* underlying data, thus gaining a significant performance benefit.
*
- * @param fileName a<code>String</code> specifying the file name which the stream is written out to.
- * The file is created relative to the location as specified in the MultipartConfig
+ * @param fileName the name of the file to which the stream will be
+ * written. The file is created relative to the location as
+ * specified in the MultipartConfig
*
* @throws IOException if an error occurs.
*/
public void write(String fileName) throws IOException;
-
/**
* Deletes the underlying storage for a file item, including deleting any
* associated temporary disk file.
@@ -124,58 +119,37 @@
* header, or <code>null</code>
* if the part does not
* have a header of that name
- *
*/
-
public String getHeader(String name);
/**
+ * Gets the values of the Part header with the given name.
*
- * Returns all the values of the specified Part header
- * as an <code>Iterable</code> of <code>String</code> objects.
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>Part</code>.
*
- * <p>If the Part did not include any headers
- * of the specified name, this method returns an empty
- * <code>Iterable</code>.
- * The header name is case insensitive. You can use
- * this method with any Part header.
+ * <p>Part header names are case insensitive.
*
- * @param name a <code>String</code> specifying the
- * header name
+ * @param name the header name whose values to return
*
- * @return an <code>Iterable</code> containing
- * the values of the requested header. If
- * the Part does not have any headers of
- * that name return an empty
- * Iterable. If
- * the container does not allow access to
- * header information, return null
- *
+ * @return a (possibly empty) <code>Collection</code> of the values of
+ * the header with the given name
*/
+ public Collection<String> getHeaders(String name);
- public Iterable<String> getHeaders(String name);
-
/**
+ * Gets the header names of this Part.
*
- * Returns an Iterable of all the header names
- * this part contains. If the part has no
- * headers, this method returns an empty Iterable.
- *
* <p>Some servlet containers do not allow
* servlets to access headers using this method, in
* which case this method returns <code>null</code>
*
- * @return an Iterable of all the
- * header names sent with this
- * part; if the part has
- * no headers, an empty Iterable;
- * if the servlet container does not
- * allow servlets to use this method,
- * <code>null</code>
+ * <p>Any changes to the returned <code>Collection</code> must not
+ * affect this <code>Part</code>.
*
- *
+ * @return a (possibly empty) <code>Collection</code> of the header
+ * names of this Part
*/
+ public Collection<String> getHeaderNames();
- public Iterable<String> getHeaderNames();
-
}
Modified: trunk/java/org/apache/catalina/connector/Request.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Request.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/org/apache/catalina/connector/Request.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -54,6 +54,7 @@
import java.security.Principal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
@@ -3112,7 +3113,7 @@
}
- public Iterable<Part> getParts() throws ServletException {
+ public Collection<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-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/org/apache/catalina/connector/RequestFacade.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -22,6 +22,7 @@
import java.io.IOException;
import java.security.AccessController;
import java.security.PrivilegedAction;
+import java.util.Collection;
import java.util.Enumeration;
import java.util.Locale;
import java.util.Map;
@@ -1132,7 +1133,7 @@
}
- public Iterable<Part> getParts() throws ServletException {
+ public Collection<Part> getParts() throws ServletException {
if (request == null) {
throw new IllegalStateException(
sm.getString("requestFacade.nullRequest"));
Modified: trunk/java/org/apache/catalina/connector/Response.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Response.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/org/apache/catalina/connector/Response.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -29,6 +29,7 @@
import java.security.PrivilegedExceptionAction;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Enumeration;
import java.util.Locale;
import java.util.TimeZone;
@@ -874,7 +875,7 @@
* Return an array of all the header names set for this response, or
* a zero-length array if no headers have been set.
*/
- public Iterable<String> getHeaderNames() {
+ public Collection<String> getHeaderNames() {
MimeHeaders headers = coyoteResponse.getMimeHeaders();
int n = headers.size();
@@ -912,7 +913,7 @@
*
* @param name Header name to look up
*/
- public Iterable<String> getHeaders(String name) {
+ public Collection<String> getHeaders(String name) {
// FIXME
return null;
}
Modified: trunk/java/org/apache/catalina/connector/ResponseFacade.java
===================================================================
--- trunk/java/org/apache/catalina/connector/ResponseFacade.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/org/apache/catalina/connector/ResponseFacade.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -24,6 +24,7 @@
import java.security.PrivilegedAction;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
+import java.util.Collection;
import java.util.Locale;
import javax.servlet.ServletOutputStream;
@@ -563,7 +564,7 @@
}
- public Iterable<String> getHeaderNames() {
+ public Collection<String> getHeaderNames() {
if (response == null) {
throw new IllegalStateException(
sm.getString("responseFacade.nullResponse"));
@@ -573,7 +574,7 @@
}
- public Iterable<String> getHeaders(String name) {
+ public Collection<String> getHeaders(String name) {
if (response == null) {
throw new IllegalStateException(
sm.getString("responseFacade.nullResponse"));
Modified: trunk/java/org/apache/catalina/core/ApplicationContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationContext.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/org/apache/catalina/core/ApplicationContext.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -52,6 +52,7 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.EventListener;
@@ -1133,6 +1134,17 @@
}
+ public int getEffectiveMajorVersion() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+
+ public int getEffectiveMinorVersion() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
// -------------------------------------------------------- Package Methods
protected StandardContext getContext() {
return this.context;
@@ -1277,19 +1289,19 @@
*/
private static final class JspConfigDescriptorImpl implements JspConfigDescriptor {
- private Iterable<JspPropertyGroupDescriptor> jspPropertyGroups;
- private Iterable<TaglibDescriptor> taglibs;
- public JspConfigDescriptorImpl(Iterable<JspPropertyGroupDescriptor> jspPropertyGroups,
- Iterable<TaglibDescriptor> taglibs) {
+ private Collection<JspPropertyGroupDescriptor> jspPropertyGroups;
+ private Collection<TaglibDescriptor> taglibs;
+ public JspConfigDescriptorImpl(Collection<JspPropertyGroupDescriptor> jspPropertyGroups,
+ Collection<TaglibDescriptor> taglibs) {
this.jspPropertyGroups = jspPropertyGroups;
this.taglibs = taglibs;
}
- public Iterable<JspPropertyGroupDescriptor> getJspPropertyGroups() {
+ public Collection<JspPropertyGroupDescriptor> getJspPropertyGroups() {
return jspPropertyGroups;
}
- public Iterable<TaglibDescriptor> getTaglibs() {
+ public Collection<TaglibDescriptor> getTaglibs() {
return taglibs;
}
Modified: trunk/java/org/apache/catalina/core/ApplicationContextFacade.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationContextFacade.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/org/apache/catalina/core/ApplicationContextFacade.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -635,6 +635,24 @@
}
+ public int getEffectiveMajorVersion() {
+ if (SecurityUtil.isPackageProtectionEnabled()) {
+ return (Integer) doPrivileged("getEffectiveMajorVersion", null);
+ } else {
+ return context.getEffectiveMajorVersion();
+ }
+ }
+
+
+ public int getEffectiveMinorVersion() {
+ if (SecurityUtil.isPackageProtectionEnabled()) {
+ return (Integer) doPrivileged("getEffectiveMinorVersion", null);
+ } else {
+ return context.getEffectiveMinorVersion();
+ }
+ }
+
+
/**
* Use reflection to invoke the requested method. Cache the method object
* to speed up the process
Modified: trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -50,6 +50,7 @@
import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
import java.util.Enumeration;
@@ -307,7 +308,7 @@
}
- public Iterable<String> getServletNameMappings() {
+ public Collection<String> getServletNameMappings() {
HashSet<String> result = new HashSet<String>();
FilterMap[] filterMaps = context.findFilterMaps();
for (int i = 0; i < filterMaps.length; i++) {
@@ -326,7 +327,7 @@
}
- public Iterable<String> getUrlPatternMappings() {
+ public Collection<String> getUrlPatternMappings() {
HashSet<String> result = new HashSet<String>();
FilterMap[] filterMaps = context.findFilterMaps();
for (int i = 0; i < filterMaps.length; i++) {
Modified: trunk/java/org/apache/catalina/core/ApplicationFilterConfigFacade.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationFilterConfigFacade.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/org/apache/catalina/core/ApplicationFilterConfigFacade.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -47,6 +47,7 @@
package org.apache.catalina.core;
+import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
import java.util.Enumeration;
@@ -169,12 +170,12 @@
}
- public Iterable<String> getServletNameMappings() {
+ public Collection<String> getServletNameMappings() {
return config.getServletNameMappings();
}
- public Iterable<String> getUrlPatternMappings() {
+ public Collection<String> getUrlPatternMappings() {
return config.getUrlPatternMappings();
}
Modified: trunk/java/org/apache/catalina/core/DummyRequest.java
===================================================================
--- trunk/java/org/apache/catalina/core/DummyRequest.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/org/apache/catalina/core/DummyRequest.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -25,6 +25,7 @@
import java.io.UnsupportedEncodingException;
import java.net.Socket;
import java.security.Principal;
+import java.util.Collection;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.Locale;
@@ -291,7 +292,7 @@
public void logout() throws ServletException {}
public long getAsyncTimeout() { return 0; }
public Part getPart(String name) throws IllegalArgumentException { return null; }
- public Iterable<Part> getParts() { return null; }
+ public Collection<Part> getParts() { return null; }
}
Modified: trunk/java/org/apache/catalina/core/DummyResponse.java
===================================================================
--- trunk/java/org/apache/catalina/core/DummyResponse.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/org/apache/catalina/core/DummyResponse.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -22,6 +22,7 @@
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
+import java.util.Collection;
import java.util.Locale;
import javax.servlet.ServletOutputStream;
@@ -97,7 +98,7 @@
public Cookie[] getCookies() { return null; }
public String getHeader(String name) { return null; }
- public Iterable<String> getHeaderNames() { return null; }
+ public Collection<String> getHeaderNames() { return null; }
public String[] getHeaderValues(String name) { return null; }
public String getMessage() { return null; }
public int getStatus() { return -1; }
@@ -123,7 +124,7 @@
public void disable() {}
public void enable() {}
public boolean isDisabled() { return false; }
- public Iterable<String> getHeaders(String name) { return null; }
+ public Collection<String> getHeaders(String name) { return null; }
}
Modified: trunk/java/org/apache/catalina/core/StandardWrapperFacade.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardWrapperFacade.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/org/apache/catalina/core/StandardWrapperFacade.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -47,6 +47,7 @@
package org.apache.catalina.core;
+import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
@@ -203,7 +204,7 @@
}
- public Iterable<String> getMappings() {
+ public Collection<String> getMappings() {
HashSet<String> result = new HashSet<String>();
String[] mappings = wrapper.findMappings();
for (int i = 0; i < mappings.length; i++) {
Modified: trunk/java/org/apache/tomcat/util/http/fileupload/DefaultFileItem.java
===================================================================
--- trunk/java/org/apache/tomcat/util/http/fileupload/DefaultFileItem.java 2009-08-17 15:53:51 UTC (rev 1143)
+++ trunk/java/org/apache/tomcat/util/http/fileupload/DefaultFileItem.java 2009-08-17 16:21:14 UTC (rev 1144)
@@ -29,6 +29,7 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
+import java.util.Collection;
import java.util.Map;
@@ -537,12 +538,12 @@
}
- public Iterable<String> getHeaderNames() {
+ public Collection<String> getHeaderNames() {
return headers.keySet();
}
- public Iterable<String> getHeaders(String name) {
+ public Collection<String> getHeaders(String name) {
// FIXME: Create a Set out of the comma separated values
return null;
}
15 years, 4 months
JBossWeb SVN: r1143 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-08-17 11:53:51 -0400 (Mon, 17 Aug 2009)
New Revision: 1143
Modified:
trunk/java/org/apache/jasper/compiler/JspUtil.java
trunk/java/org/apache/jasper/compiler/ScriptingVariabler.java
trunk/webapps/docs/changelog.xml
Log:
- Port two small Jasper patches.
Modified: trunk/java/org/apache/jasper/compiler/JspUtil.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/JspUtil.java 2009-08-17 12:48:31 UTC (rev 1142)
+++ trunk/java/org/apache/jasper/compiler/JspUtil.java 2009-08-17 15:53:51 UTC (rev 1143)
@@ -506,7 +506,7 @@
* or, if it's a primitive, the name of its correspondent boxed
* type.
*/
- String targetType = expectedType.getName();
+ String targetType = getCanonicalName(expectedType);
String primitiveConverterMethod = null;
if (expectedType.isPrimitive()) {
if (expectedType.equals(Boolean.TYPE)) {
Modified: trunk/java/org/apache/jasper/compiler/ScriptingVariabler.java
===================================================================
--- trunk/java/org/apache/jasper/compiler/ScriptingVariabler.java 2009-08-17 12:48:31 UTC (rev 1142)
+++ trunk/java/org/apache/jasper/compiler/ScriptingVariabler.java 2009-08-17 15:53:51 UTC (rev 1143)
@@ -68,7 +68,7 @@
public void visit(Node.CustomTag n) throws JasperException {
setScriptingVars(n, VariableInfo.AT_BEGIN);
setScriptingVars(n, VariableInfo.NESTED);
- visitBody(n);
+ new ScriptingVariableVisitor(err).visitBody(n);
setScriptingVars(n, VariableInfo.AT_END);
}
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2009-08-17 12:48:31 UTC (rev 1142)
+++ trunk/webapps/docs/changelog.xml 2009-08-17 15:53:51 UTC (rev 1143)
@@ -174,6 +174,13 @@
<fix>
<bug>47413</bug>: First part of a composite expression "${a}${b}" was not coerced to String. (kkolinko)
</fix>
+ <fix>
+ <bug>41824</bug>: Need to use canonical rather than binary form when writing code. (markt)
+ </fix>
+ <fix>
+ <bug>42390</bug>: Correct JSP compilation error with nested tagfile tags with variables with "AT_BEGIN" scope.
+ Patch provided by Konstantin Kolinko. (markt)
+ </fix>
</changelog>
</subsection>
</section>
15 years, 4 months
JBossWeb SVN: r1142 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-08-17 08:48:31 -0400 (Mon, 17 Aug 2009)
New Revision: 1142
Modified:
trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java
trunk/java/org/apache/catalina/core/LocalStrings.properties
trunk/java/org/apache/catalina/core/mbeans-descriptors.xml
trunk/webapps/docs/changelog.xml
Log:
- Port JMX filter registration.
Modified: trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java 2009-08-04 16:40:02 UTC (rev 1141)
+++ trunk/java/org/apache/catalina/core/ApplicationFilterConfig.java 2009-08-17 12:48:31 UTC (rev 1142)
@@ -59,6 +59,7 @@
import java.util.Map;
import java.util.Set;
+import javax.management.ObjectName;
import javax.naming.NamingException;
import javax.servlet.DispatcherType;
import javax.servlet.Filter;
@@ -76,6 +77,7 @@
import org.apache.catalina.util.StringManager;
import org.apache.tomcat.InstanceManager;
import org.apache.tomcat.util.log.SystemLogHandler;
+import org.apache.tomcat.util.modeler.Registry;
/**
@@ -90,6 +92,9 @@
public final class ApplicationFilterConfig implements FilterConfig, Serializable {
+ protected static org.jboss.logging.Logger log=
+ org.jboss.logging.Logger.getLogger( ApplicationFilterConfig.class );
+
protected static StringManager sm =
StringManager.getManager(Constants.Package);
@@ -155,6 +160,12 @@
private transient InstanceManager instanceManager;
+ /**
+ * JMX registration name
+ */
+ private ObjectName oname;
+
+
// --------------------------------------------------- FilterConfig Methods
@@ -167,6 +178,14 @@
/**
+ * Return the class of the filter we are configuring.
+ */
+ public String getFilterClass() {
+ return filterDef.getFilterClass();
+ }
+
+
+ /**
* Return a <code>String</code> containing the value of the named
* initialization parameter, or <code>null</code> if the parameter
* does not exist.
@@ -364,6 +383,11 @@
}
+ public Map<String, String> getInitParameters() {
+ return Collections.unmodifiableMap(filterDef.getParameterMap());
+ }
+
+
// -------------------------------------------------------- Package Methods
@@ -412,9 +436,12 @@
} else {
filter.init(this);
}
+
+ // Expose filter via JMX
+ registerJMX();
+
return (this.filter);
-
}
@@ -441,6 +468,8 @@
*/
void release() {
+ unregsiterJMX();
+
if (this.filter != null)
{
if (Globals.IS_SECURITY_ENABLED) {
@@ -483,4 +512,55 @@
return instanceManager;
}
+ private void registerJMX() {
+ String parentName = context.getName();
+ parentName = ("".equals(parentName)) ? "/" : parentName;
+
+ String hostName = context.getParent().getName();
+ hostName = (hostName == null) ? "DEFAULT" : hostName;
+
+ // domain == engine name
+ String domain = context.getParent().getParent().getName();
+
+ String webMod = "//" + hostName + parentName;
+ String onameStr = null;
+ if (context instanceof StandardContext) {
+ StandardContext standardContext = (StandardContext) context;
+ onameStr = domain + ":j2eeType=Filter,name=" +
+ filterDef.getFilterName() + ",WebModule=" + webMod +
+ ",J2EEApplication=" +
+ standardContext.getJ2EEApplication() + ",J2EEServer=" +
+ standardContext.getJ2EEServer();
+ } else {
+ onameStr = domain + ":j2eeType=Filter,name=" +
+ filterDef.getFilterName() + ",WebModule=" + webMod;
+ }
+ try {
+ oname = new ObjectName(onameStr);
+ Registry.getRegistry(null, null).registerComponent(this, oname,
+ null);
+ } catch (Exception ex) {
+ log.info(sm.getString("applicationFilterConfig.jmxRegsiterFail",
+ getFilterClass(), getFilterName()), ex);
+ }
+ }
+
+ private void unregsiterJMX() {
+ // unregister this component
+ if (oname != null) {
+ try {
+ Registry.getRegistry(null, null).unregisterComponent(oname);
+ if(log.isDebugEnabled())
+ log.debug(sm.getString(
+ "applicationFilterConfig.jmxUnregsiter",
+ getFilterClass(), getFilterName()));
+ } catch(Exception ex) {
+ log.error(sm.getString(
+ "applicationFilterConfig.jmxUnregsiterFail",
+ getFilterClass(), getFilterName()), ex);
+ }
+ }
+
+ }
+
}
Modified: trunk/java/org/apache/catalina/core/LocalStrings.properties
===================================================================
--- trunk/java/org/apache/catalina/core/LocalStrings.properties 2009-08-04 16:40:02 UTC (rev 1141)
+++ trunk/java/org/apache/catalina/core/LocalStrings.properties 2009-08-17 12:48:31 UTC (rev 1142)
@@ -31,6 +31,9 @@
applicationDispatcher.serviceException=Servlet.service() for servlet {0} threw exception
applicationDispatcher.specViolation.request=Original SevletRequest or wrapped original ServletRequest not passed to RequestDispatcher in violation of SRV.8.2 and SRV.14.2.5.1
applicationDispatcher.specViolation.response=Original SevletResponse or wrapped original ServletResponse not passed to RequestDispatcher in violation of SRV.8.2 and SRV.14.2.5.1
+applicationFilterConfig.jmxRegisterFail=JMX registration failed for filter of type [{0}] and name [{1}]
+applicationFilterConfig.jmxUnregister=JMX de-registration complete for filter of type [{0}] and name [{1}]
+applicationFilterConfig.jmxUnregisterFail=JMX de-registration failed for filter of type [{0}] and name [{1}]
applicationRequest.badParent=Cannot locate parent Request implementation
applicationRequest.badRequest=Request is not a javax.servlet.ServletRequestWrapper
applicationResponse.badParent=Cannot locate parent Response implementation
Modified: trunk/java/org/apache/catalina/core/mbeans-descriptors.xml
===================================================================
--- trunk/java/org/apache/catalina/core/mbeans-descriptors.xml 2009-08-04 16:40:02 UTC (rev 1141)
+++ trunk/java/org/apache/catalina/core/mbeans-descriptors.xml 2009-08-17 12:48:31 UTC (rev 1142)
@@ -1,6 +1,29 @@
<?xml version="1.0"?>
<mbeans-descriptors>
+ <mbean name="ApplicationFilterConfig"
+ description="Wrapper that represents an individual servlet-filter definition"
+ domain="Catalina"
+ group="Filter"
+ type="org.apache.catalina.core.ApplicationFilterConfig">
+
+ <attribute name="filterName"
+ description="The name used to reference the filter in web.xml"
+ type="java.lang.String"
+ writeable="false"/>
+
+ <attribute name="filterClass"
+ description="Fully qualified class name of the filter object"
+ type="java.lang.String"
+ writeable="false"/>
+
+ <attribute name="initParameters"
+ description="Return the initiaization parameters associated with this filter"
+ type="java.util.Map"
+ writeable="false" />
+
+ </mbean>
+
<mbean name="NamingContextListener"
description="Helper class used to initialize and populate the JNDI context associated with each context and server"
domain="Catalina"
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2009-08-04 16:40:02 UTC (rev 1141)
+++ trunk/webapps/docs/changelog.xml 2009-08-17 12:48:31 UTC (rev 1142)
@@ -127,6 +127,9 @@
<bug>41059</bug>: Reduce one possible source of errors if using ENABLE_CLEAR_REFERENCES=true.
Patch by Curt Arnold. (markt)
</fix>
+ <fix>
+ Register filters with JMX. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
@@ -140,6 +143,9 @@
<fix>
Fix handling of timeout values <= 0 with the poller refactoring. (remm)
</fix>
+ <fix>
+ <jboss-jira>JBAS-6442</jboss-jira>: The character encoder should tolerate unmappable characters. (jfclere)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
15 years, 4 months
JBossWeb SVN: r1141 - trunk/java/org/apache/tomcat/util/buf.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-08-04 12:40:02 -0400 (Tue, 04 Aug 2009)
New Revision: 1141
Modified:
trunk/java/org/apache/tomcat/util/buf/C2BConverter.java
Log:
Fix for JBAS-6442
Modified: trunk/java/org/apache/tomcat/util/buf/C2BConverter.java
===================================================================
--- trunk/java/org/apache/tomcat/util/buf/C2BConverter.java 2009-08-04 16:33:39 UTC (rev 1140)
+++ trunk/java/org/apache/tomcat/util/buf/C2BConverter.java 2009-08-04 16:40:02 UTC (rev 1141)
@@ -25,6 +25,7 @@
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import java.nio.charset.UnsupportedCharsetException;
+import java.nio.charset.CodingErrorAction;
/**
* NIO based character encoder.
@@ -46,7 +47,10 @@
public C2BConverter(String charset)
throws IOException {
try {
+ byte[] newReplacement = { (byte)'?' };
encoder = Charset.forName(charset).newEncoder();
+ encoder = encoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
+ encoder = encoder.replaceWith(newReplacement);
} catch (UnsupportedCharsetException e) {
throw new UnsupportedEncodingException(charset);
}
15 years, 5 months
JBossWeb SVN: r1140 - branches/2.1.x/java/org/apache/tomcat/util/buf.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-08-04 12:33:39 -0400 (Tue, 04 Aug 2009)
New Revision: 1140
Modified:
branches/2.1.x/java/org/apache/tomcat/util/buf/C2BConverter.java
Log:
Fix for JBAS-6442.
Modified: branches/2.1.x/java/org/apache/tomcat/util/buf/C2BConverter.java
===================================================================
--- branches/2.1.x/java/org/apache/tomcat/util/buf/C2BConverter.java 2009-07-20 16:46:09 UTC (rev 1139)
+++ branches/2.1.x/java/org/apache/tomcat/util/buf/C2BConverter.java 2009-08-04 16:33:39 UTC (rev 1140)
@@ -25,6 +25,7 @@
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import java.nio.charset.UnsupportedCharsetException;
+import java.nio.charset.CodingErrorAction;
/**
* NIO based character encoder.
@@ -46,7 +47,10 @@
public C2BConverter(String charset)
throws IOException {
try {
+ byte[] newReplacement = { (byte)'?' };
encoder = Charset.forName(charset).newEncoder();
+ encoder = encoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
+ encoder = encoder.replaceWith(newReplacement);
} catch (UnsupportedCharsetException e) {
throw new UnsupportedEncodingException(charset);
}
15 years, 5 months