JBossWeb SVN: r935 - in branches/2.1.x: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-02-16 12:24:50 -0500 (Mon, 16 Feb 2009)
New Revision: 935
Modified:
branches/2.1.x/build.properties.default
branches/2.1.x/webapps/docs/changelog.xml
Log:
- NSIS 2.43.
Modified: branches/2.1.x/build.properties.default
===================================================================
--- branches/2.1.x/build.properties.default 2009-02-14 03:45:44 UTC (rev 934)
+++ branches/2.1.x/build.properties.default 2009-02-16 17:24:50 UTC (rev 935)
@@ -59,12 +59,12 @@
commons-collections-src.loc=${base-commons.loc}/collections/source/commons-collections-3.2.1-src.tar.gz
# ----- NSIS, version 2.0 or later -----
-nsis.home=${base.path}/nsis-2.41
+nsis.home=${base.path}/nsis-2.43
nsis.exe=${nsis.home}/makensis.exe
nsis.installoptions.dll=${nsis.home}/Plugins/InstallOptions.dll
nsis.nsexec.dll=${nsis.home}/Plugins/nsExec.dll
nsis.nsisdl.dll=${nsis.home}/Plugins/NSISdl.dll
-nsis.loc=${base-sf.loc}/nsis/nsis-2.41.zip
+nsis.loc=${base-sf.loc}/nsis/nsis-2.43.zip
# ----- JBoss Native, version 2.0 or later -----
jbossnative.home=${base.path}/jboss-native-2.0.6
Modified: branches/2.1.x/webapps/docs/changelog.xml
===================================================================
--- branches/2.1.x/webapps/docs/changelog.xml 2009-02-14 03:45:44 UTC (rev 934)
+++ branches/2.1.x/webapps/docs/changelog.xml 2009-02-16 17:24:50 UTC (rev 935)
@@ -19,6 +19,9 @@
<section name="JBoss Web 2.1.2.GA (remm)">
<subsection name="General">
<changelog>
+ <update>
+ NSIS 2.43. (remm)
+ </update>
</changelog>
</subsection>
<subsection name="Catalina">
15 years, 10 months
JBossWeb SVN: r934 - in branches/2.1.x: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-02-13 22:45:44 -0500 (Fri, 13 Feb 2009)
New Revision: 934
Modified:
branches/2.1.x/java/org/apache/tomcat/util/http/ServerCookie.java
branches/2.1.x/webapps/docs/changelog.xml
Log:
- v0 optimization.
Modified: branches/2.1.x/java/org/apache/tomcat/util/http/ServerCookie.java
===================================================================
--- branches/2.1.x/java/org/apache/tomcat/util/http/ServerCookie.java 2009-02-14 03:45:27 UTC (rev 933)
+++ branches/2.1.x/java/org/apache/tomcat/util/http/ServerCookie.java 2009-02-14 03:45:44 UTC (rev 934)
@@ -57,14 +57,20 @@
// Other fields
private static final String OLD_COOKIE_PATTERN =
"EEE, dd-MMM-yyyy HH:mm:ss z";
- private static final DateFormat OLD_COOKIE_FORMAT;
+ private static final ThreadLocal<DateFormat> OLD_COOKIE_FORMAT =
+ new ThreadLocal<DateFormat>() {
+ protected DateFormat initialValue() {
+ DateFormat df =
+ new SimpleDateFormat(OLD_COOKIE_PATTERN, Locale.US);
+ df.setTimeZone(TimeZone.getTimeZone("GMT"));
+ return df;
+ }
+ };
private static final String ancientDate;
static {
- OLD_COOKIE_FORMAT = new SimpleDateFormat(OLD_COOKIE_PATTERN, Locale.US);
- OLD_COOKIE_FORMAT.setTimeZone(TimeZone.getTimeZone("GMT"));
- ancientDate = OLD_COOKIE_FORMAT.format(new Date(10000));
+ ancientDate = OLD_COOKIE_FORMAT.get().format(new Date(10000));
}
/**
@@ -306,16 +312,14 @@
// Wdy, DD-Mon-YY HH:MM:SS GMT ( Expires Netscape format )
buf.append ("; Expires=");
// To expire immediately we need to set the time in past
- if (maxAge == 0)
+ if (maxAge == 0) {
buf.append( ancientDate );
- else
- synchronized (OLD_COOKIE_FORMAT) {
- OLD_COOKIE_FORMAT.format(
- new Date(System.currentTimeMillis() +
- maxAge*1000L),
- buf, new FieldPosition(0));
- }
-
+ } else {
+ OLD_COOKIE_FORMAT.get().format(
+ new Date(System.currentTimeMillis() +
+ maxAge*1000L),
+ buf, new FieldPosition(0));
+ }
} else {
buf.append ("; Max-Age=");
buf.append (maxAge);
Modified: branches/2.1.x/webapps/docs/changelog.xml
===================================================================
--- branches/2.1.x/webapps/docs/changelog.xml 2009-02-14 03:45:27 UTC (rev 933)
+++ branches/2.1.x/webapps/docs/changelog.xml 2009-02-14 03:45:44 UTC (rev 934)
@@ -46,6 +46,9 @@
<fix>
HTTP/1.0 handling differed from the old org.apache.jk connector. (remm)
</fix>
+ <fix>
+ Optimize date format for v0 cookies. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
15 years, 10 months
JBossWeb SVN: r933 - in trunk: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-02-13 22:45:27 -0500 (Fri, 13 Feb 2009)
New Revision: 933
Modified:
trunk/java/org/apache/tomcat/util/http/ServerCookie.java
trunk/webapps/docs/changelog.xml
Log:
- v0 optimization.
Modified: trunk/java/org/apache/tomcat/util/http/ServerCookie.java
===================================================================
--- trunk/java/org/apache/tomcat/util/http/ServerCookie.java 2009-02-14 03:44:44 UTC (rev 932)
+++ trunk/java/org/apache/tomcat/util/http/ServerCookie.java 2009-02-14 03:45:27 UTC (rev 933)
@@ -57,14 +57,20 @@
// Other fields
private static final String OLD_COOKIE_PATTERN =
"EEE, dd-MMM-yyyy HH:mm:ss z";
- private static final DateFormat OLD_COOKIE_FORMAT;
+ private static final ThreadLocal<DateFormat> OLD_COOKIE_FORMAT =
+ new ThreadLocal<DateFormat>() {
+ protected DateFormat initialValue() {
+ DateFormat df =
+ new SimpleDateFormat(OLD_COOKIE_PATTERN, Locale.US);
+ df.setTimeZone(TimeZone.getTimeZone("GMT"));
+ return df;
+ }
+ };
private static final String ancientDate;
static {
- OLD_COOKIE_FORMAT = new SimpleDateFormat(OLD_COOKIE_PATTERN, Locale.US);
- OLD_COOKIE_FORMAT.setTimeZone(TimeZone.getTimeZone("GMT"));
- ancientDate = OLD_COOKIE_FORMAT.format(new Date(10000));
+ ancientDate = OLD_COOKIE_FORMAT.get().format(new Date(10000));
}
/**
@@ -306,16 +312,14 @@
// Wdy, DD-Mon-YY HH:MM:SS GMT ( Expires Netscape format )
buf.append ("; Expires=");
// To expire immediately we need to set the time in past
- if (maxAge == 0)
+ if (maxAge == 0) {
buf.append( ancientDate );
- else
- synchronized (OLD_COOKIE_FORMAT) {
- OLD_COOKIE_FORMAT.format(
- new Date(System.currentTimeMillis() +
- maxAge*1000L),
- buf, new FieldPosition(0));
- }
-
+ } else {
+ OLD_COOKIE_FORMAT.get().format(
+ new Date(System.currentTimeMillis() +
+ maxAge*1000L),
+ buf, new FieldPosition(0));
+ }
} else {
buf.append ("; Max-Age=");
buf.append (maxAge);
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2009-02-14 03:44:44 UTC (rev 932)
+++ trunk/webapps/docs/changelog.xml 2009-02-14 03:45:27 UTC (rev 933)
@@ -70,6 +70,9 @@
<fix>
HTTP/1.0 handling differed from the old org.apache.jk connector. (remm)
</fix>
+ <fix>
+ Optimize date format for v0 cookies. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
15 years, 10 months
JBossWeb SVN: r932 - 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-02-13 22:44:44 -0500 (Fri, 13 Feb 2009)
New Revision: 932
Modified:
trunk/java/org/apache/catalina/core/ApplicationContextFacade.java
trunk/java/org/apache/catalina/core/StandardWrapperFacade.java
trunk/java/org/apache/catalina/startup/ContextConfig.java
Log:
- Try ServletRegistration.
Modified: trunk/java/org/apache/catalina/core/ApplicationContextFacade.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationContextFacade.java 2009-02-13 17:27:21 UTC (rev 931)
+++ trunk/java/org/apache/catalina/core/ApplicationContextFacade.java 2009-02-14 03:44:44 UTC (rev 932)
@@ -30,10 +30,8 @@
import java.util.EnumSet;
import java.util.Enumeration;
import java.util.HashMap;
-import java.util.Map;
import java.util.Set;
-import javax.servlet.DispatcherType;
import javax.servlet.FilterRegistration;
import javax.servlet.RequestDispatcher;
import javax.servlet.Servlet;
Modified: trunk/java/org/apache/catalina/core/StandardWrapperFacade.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardWrapperFacade.java 2009-02-13 17:27:21 UTC (rev 931)
+++ trunk/java/org/apache/catalina/core/StandardWrapperFacade.java 2009-02-14 03:44:44 UTC (rev 932)
@@ -20,9 +20,11 @@
import java.util.Enumeration;
+import java.util.Map;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
+import javax.servlet.ServletRegistration;
/**
@@ -33,6 +35,7 @@
*/
public final class StandardWrapperFacade
+ extends ServletRegistration
implements ServletConfig {
@@ -42,10 +45,10 @@
/**
* Create a new facede around a StandardWrapper.
*/
- public StandardWrapperFacade(StandardWrapper config) {
+ public StandardWrapperFacade(StandardWrapper wrapper) {
super();
- this.config = (ServletConfig) config;
+ this.wrapper = wrapper;
}
@@ -56,7 +59,7 @@
/**
* Wrapped config.
*/
- private ServletConfig config = null;
+ private StandardWrapper wrapper = null;
/**
@@ -69,13 +72,13 @@
public String getServletName() {
- return config.getServletName();
+ return wrapper.getServletName();
}
public ServletContext getServletContext() {
if (context == null) {
- context = config.getServletContext();
+ context = wrapper.getServletContext();
if ((context != null) && (context instanceof ApplicationContext))
context = ((ApplicationContext) context).getFacade();
}
@@ -84,13 +87,55 @@
public String getInitParameter(String name) {
- return config.getInitParameter(name);
+ return wrapper.getInitParameter(name);
}
public Enumeration getInitParameterNames() {
- return config.getInitParameterNames();
+ return wrapper.getInitParameterNames();
}
+ @Override
+ public void addMapping(String... urlPatterns) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public void setAsyncSupported(boolean asyncSupported) {
+ // TODO Auto-generated method stub
+ super.setAsyncSupported(asyncSupported);
+ }
+
+
+ @Override
+ public void setDescription(String description) {
+ // TODO Auto-generated method stub
+ super.setDescription(description);
+ }
+
+
+ @Override
+ public void setInitParameter(String name, String value) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public void setInitParameters(Map<String, String> initParameters) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ public void setLoadOnStartup(int loadOnStartup) {
+ // TODO Auto-generated method stub
+ super.setLoadOnStartup(loadOnStartup);
+ }
+
+
}
Modified: trunk/java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-02-13 17:27:21 UTC (rev 931)
+++ trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-02-14 03:44:44 UTC (rev 932)
@@ -1098,6 +1098,7 @@
}
// Process the default and application web.xml files
+ // FIXME: Processing of web fragments
defaultWebConfig();
applicationWebConfig();
if (!context.getIgnoreAnnotations()) {
15 years, 10 months
JBossWeb SVN: r931 - in trunk/java: javax/servlet/http and 6 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-02-13 12:27:21 -0500 (Fri, 13 Feb 2009)
New Revision: 931
Added:
trunk/java/javax/servlet/FilterRegistration.java
trunk/java/javax/servlet/ServletRegistration.java
trunk/java/javax/servlet/http/annotation/
trunk/java/javax/servlet/http/annotation/FilterMapping.java
trunk/java/javax/servlet/http/annotation/InitParam.java
trunk/java/javax/servlet/http/annotation/Servlet.java
trunk/java/javax/servlet/http/annotation/ServletContextListener.java
trunk/java/javax/servlet/http/annotation/ServletFilter.java
Removed:
trunk/java/javax/servlet/LocalStrings.properties
trunk/java/javax/servlet/LocalStrings_es.properties
trunk/java/javax/servlet/LocalStrings_fr.properties
trunk/java/javax/servlet/LocalStrings_ja.properties
trunk/java/javax/servlet/annotation/
trunk/java/javax/servlet/http/LocalStrings.properties
trunk/java/javax/servlet/http/LocalStrings_es.properties
trunk/java/javax/servlet/http/LocalStrings_fr.properties
trunk/java/javax/servlet/http/LocalStrings_ja.properties
trunk/java/javax/servlet/http/package.html
trunk/java/javax/servlet/package.html
trunk/java/org/apache/catalina/ClassLoadingAnnotationScanner.java
Modified:
trunk/java/javax/servlet/AsyncContext.java
trunk/java/javax/servlet/AsyncEvent.java
trunk/java/javax/servlet/AsyncListener.java
trunk/java/javax/servlet/DispatcherType.java
trunk/java/javax/servlet/Filter.java
trunk/java/javax/servlet/FilterChain.java
trunk/java/javax/servlet/FilterConfig.java
trunk/java/javax/servlet/GenericServlet.java
trunk/java/javax/servlet/RequestDispatcher.java
trunk/java/javax/servlet/Servlet.java
trunk/java/javax/servlet/ServletConfig.java
trunk/java/javax/servlet/ServletContext.java
trunk/java/javax/servlet/ServletContextAttributeEvent.java
trunk/java/javax/servlet/ServletContextAttributeListener.java
trunk/java/javax/servlet/ServletContextEvent.java
trunk/java/javax/servlet/ServletContextListener.java
trunk/java/javax/servlet/ServletException.java
trunk/java/javax/servlet/ServletInputStream.java
trunk/java/javax/servlet/ServletOutputStream.java
trunk/java/javax/servlet/ServletRequest.java
trunk/java/javax/servlet/ServletRequestAttributeEvent.java
trunk/java/javax/servlet/ServletRequestAttributeListener.java
trunk/java/javax/servlet/ServletRequestEvent.java
trunk/java/javax/servlet/ServletRequestListener.java
trunk/java/javax/servlet/ServletRequestWrapper.java
trunk/java/javax/servlet/ServletResponse.java
trunk/java/javax/servlet/ServletResponseWrapper.java
trunk/java/javax/servlet/SessionCookieConfig.java
trunk/java/javax/servlet/SessionTrackingMode.java
trunk/java/javax/servlet/SingleThreadModel.java
trunk/java/javax/servlet/UnavailableException.java
trunk/java/javax/servlet/http/Cookie.java
trunk/java/javax/servlet/http/HttpServlet.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/HttpSession.java
trunk/java/javax/servlet/http/HttpSessionActivationListener.java
trunk/java/javax/servlet/http/HttpSessionAttributeListener.java
trunk/java/javax/servlet/http/HttpSessionBindingEvent.java
trunk/java/javax/servlet/http/HttpSessionBindingListener.java
trunk/java/javax/servlet/http/HttpSessionContext.java
trunk/java/javax/servlet/http/HttpSessionEvent.java
trunk/java/javax/servlet/http/HttpSessionListener.java
trunk/java/javax/servlet/http/HttpUtils.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/ClassLoadingAnnotationScanner.java
trunk/java/org/apache/catalina/core/DummyRequest.java
trunk/java/org/apache/catalina/core/DummyResponse.java
trunk/java/org/apache/catalina/startup/ContextConfig.java
trunk/java/org/apache/jasper/servlet/JspCServletContext.java
Log:
- Update of the day of the API files. API sources are from Geronimo right now.
Modified: trunk/java/javax/servlet/AsyncContext.java
===================================================================
--- trunk/java/javax/servlet/AsyncContext.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/AsyncContext.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,33 +1,48 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
package javax.servlet;
/**
+ * @version $Rev: 743426 $ $Date: 2009-02-11 18:52:39 +0100 (Wed, 11 Feb 2009) $
* @since 3.0
- * $Id: AsyncContext.java 731967 2009-01-06 15:15:32Z markt $
- * TODO SERVLET3
*/
public interface AsyncContext {
+
+ String ASYNC_CONTEXT_PATH = "javax.servlet.async.context_path";
+ String ASYNC_PATH_INFO = "javax.servlet.async.path_info";
+ String ASYNC_QUERY_STRING = "javax.servlet.async.query_string";
+ String ASYNC_REQUEST_URI = "javax.servlet.async.request_uri";
+ String ASYNC_SERVLET_PATH = "javax.servlet.async.servlet_path";
+
+ void complete();
+
+ void dispatch();
+
+ void dispatch(ServletContext servletContext, String path);
+
ServletRequest getRequest();
+
ServletResponse getResponse();
- boolean hasOriginalRequestAndResponse();
- void forward();
- void forward(String path);
- void forward(ServletContext context, String path);
- void complete();
+
+ boolean hasOriginalRequestAndResonse();
+
void start(Runnable run);
}
Modified: trunk/java/javax/servlet/AsyncEvent.java
===================================================================
--- trunk/java/javax/servlet/AsyncEvent.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/AsyncEvent.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,39 +1,43 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
package javax.servlet;
/**
+ * @version $Rev: 743426 $ $Date: 2009-02-11 18:52:39 +0100 (Wed, 11 Feb 2009) $
* @since 3.0
- * $Id: AsyncEvent.java 731967 2009-01-06 15:15:32Z markt $
- * TODO SERVLET3
*/
public class AsyncEvent {
- private ServletRequest request;
- private ServletResponse response;
-
- AsyncEvent(ServletRequest request, ServletResponse response) {
+
+ private final ServletRequest request;
+ private final ServletResponse response;
+
+ public AsyncEvent(ServletRequest request, ServletResponse response) {
this.request = request;
this.response = response;
}
-
+
public ServletRequest getRequest() {
return request;
}
-
+
public ServletResponse getResponse() {
return response;
}
Modified: trunk/java/javax/servlet/AsyncListener.java
===================================================================
--- trunk/java/javax/servlet/AsyncListener.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/AsyncListener.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,29 +1,34 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
package javax.servlet;
-import java.io.IOException;
+import java.util.EventListener;
/**
+ * @version $Rev: 743426 $ $Date: 2009-02-11 18:52:39 +0100 (Wed, 11 Feb 2009) $
* @since 3.0
- * $Id: AsyncListener.java 731967 2009-01-06 15:15:32Z markt $
- * TODO SERVLET3
*/
-public interface AsyncListener {
- void onComplete(AsyncEvent event) throws IOException;
- void onTimeout(AsyncEvent event) throws IOException;
+public interface AsyncListener extends EventListener {
+
+ void onComplete(AsyncEvent event);
+
+ void onTimeout(AsyncEvent event);
}
Modified: trunk/java/javax/servlet/DispatcherType.java
===================================================================
--- trunk/java/javax/servlet/DispatcherType.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/DispatcherType.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,28 +1,34 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
package javax.servlet;
/**
+ * @version $Rev: 743426 $ $Date: 2009-02-11 18:52:39 +0100 (Wed, 11 Feb 2009) $
* @since 3.0
- * $Id: DispatcherType.java 734696 2009-01-15 13:24:26Z markt $
*/
public enum DispatcherType {
+
+ ERROR,
FORWARD,
INCLUDE,
REQUEST,
- ERROR
+ ASYNC
}
Modified: trunk/java/javax/servlet/Filter.java
===================================================================
--- trunk/java/javax/servlet/Filter.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/Filter.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet;
import java.io.IOException;
Modified: trunk/java/javax/servlet/FilterChain.java
===================================================================
--- trunk/java/javax/servlet/FilterChain.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/FilterChain.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet;
import java.io.IOException;
Modified: trunk/java/javax/servlet/FilterConfig.java
===================================================================
--- trunk/java/javax/servlet/FilterConfig.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/FilterConfig.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,23 +1,24 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package javax.servlet;
-
import java.util.Enumeration;
/**
@@ -84,7 +85,7 @@
*
*/
- public Enumeration<String> getInitParameterNames();
+ public Enumeration getInitParameterNames();
Added: trunk/java/javax/servlet/FilterRegistration.java
===================================================================
--- trunk/java/javax/servlet/FilterRegistration.java (rev 0)
+++ trunk/java/javax/servlet/FilterRegistration.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package javax.servlet;
+
+import java.util.EnumSet;
+import java.util.Map;
+
+/**
+ * @version $Rev: 743426 $ $Date: 2009-02-11 18:52:39 +0100 (Wed, 11 Feb 2009) $
+ * @since 3.0
+ */
+public abstract class FilterRegistration {
+ protected String description;
+ protected boolean isAsyncSupported;
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public void setAsyncSupported(boolean asyncSupported) {
+ isAsyncSupported = asyncSupported;
+ }
+
+ public abstract void addMappingForServletNames(EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, String ... servletNames);
+
+ public abstract void addMappingForUrlPatterns(EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, String ... urlPatterns);
+
+ public abstract void setInitParameter(String name, String value);
+
+ public abstract void setInitParameters(Map<String, String> initParameters);
+
+}
Modified: trunk/java/javax/servlet/GenericServlet.java
===================================================================
--- trunk/java/javax/servlet/GenericServlet.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/GenericServlet.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet;
import java.io.IOException;
@@ -119,7 +122,7 @@
*
*/
- public Enumeration<String> getInitParameterNames() {
+ public Enumeration getInitParameterNames() {
return getServletConfig().getInitParameterNames();
}
Deleted: trunk/java/javax/servlet/LocalStrings.properties
===================================================================
--- trunk/java/javax/servlet/LocalStrings.properties 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/LocalStrings.properties 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,21 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Default localized string information
-# Localized for Locale en_US
-
-err.not_iso8859_1=Not an ISO 8859-1 character: {0}
-value.true=true
-value.false=false
Deleted: trunk/java/javax/servlet/LocalStrings_es.properties
===================================================================
--- trunk/java/javax/servlet/LocalStrings_es.properties 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/LocalStrings_es.properties 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,18 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-err.not_iso8859_1 = No es un car\u00E1cter ISO 8859-1\: {0}
-value.true = true
-value.false = false
Deleted: trunk/java/javax/servlet/LocalStrings_fr.properties
===================================================================
--- trunk/java/javax/servlet/LocalStrings_fr.properties 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/LocalStrings_fr.properties 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,23 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Default localized string information
-# Localized for Locale fr_FR
-
-err.not_iso8859_1={0} n''est pas un caract�re ISO 8859-1
-value.true=true
-value.false=false
-
-
Deleted: trunk/java/javax/servlet/LocalStrings_ja.properties
===================================================================
--- trunk/java/javax/servlet/LocalStrings_ja.properties 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/LocalStrings_ja.properties 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,21 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Default localized string information
-# Localized for Locale ja_JP
-
-err.not_iso8859_1=ISO 8859-1 \u306e\u6587\u5b57\u3067\u306f\u3042\u308a\u307e\u305b\u3093: {0}
-value.true=true
-value.false=false
Modified: trunk/java/javax/servlet/RequestDispatcher.java
===================================================================
--- trunk/java/javax/servlet/RequestDispatcher.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/RequestDispatcher.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,21 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package javax.servlet;
Modified: trunk/java/javax/servlet/Servlet.java
===================================================================
--- trunk/java/javax/servlet/Servlet.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/Servlet.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,20 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
-
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet;
import java.io.IOException;
Modified: trunk/java/javax/servlet/ServletConfig.java
===================================================================
--- trunk/java/javax/servlet/ServletConfig.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/ServletConfig.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet;
import java.util.Enumeration;
@@ -89,7 +92,7 @@
*
*/
- public Enumeration<String> getInitParameterNames();
+ public Enumeration getInitParameterNames();
}
Modified: trunk/java/javax/servlet/ServletContext.java
===================================================================
--- trunk/java/javax/servlet/ServletContext.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/ServletContext.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,28 +1,31 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
-import java.util.EnumSet;
import java.util.Enumeration;
+import java.util.Set;
import java.util.Map;
-import java.util.Set;
+import java.util.EnumSet;
/**
@@ -92,10 +95,10 @@
/**
* Returns the major version of the Java Servlet API that this
* servlet container supports. All implementations that comply
- * with Version 3.0 must have this method
- * return the integer 3.
+ * with Version 2.4 must have this method
+ * return the integer 2.
*
- * @return 3
+ * @return 2
*
*/
@@ -106,10 +109,10 @@
/**
* Returns the minor 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 0.
+ * with Version 2.4 must have this method
+ * return the integer 4.
*
- * @return 0
+ * @return 4
*
*/
@@ -162,7 +165,7 @@
* @since Servlet 2.3
*/
- public Set<String> getResourcePaths(String path);
+ public Set getResourcePaths(String path);
@@ -352,7 +355,7 @@
*
*/
- public Enumeration<Servlet> getServlets();
+ public Enumeration getServlets();
@@ -371,7 +374,7 @@
*
*/
- public Enumeration<String> getServletNames();
+ public Enumeration getServletNames();
@@ -524,7 +527,7 @@
* @see ServletConfig#getInitParameter
*/
- public Enumeration<String> getInitParameterNames();
+ public Enumeration getInitParameterNames();
@@ -577,7 +580,7 @@
*
*/
- public Enumeration<String> getAttributeNames();
+ public Enumeration getAttributeNames();
@@ -643,87 +646,93 @@
*/
public String getServletContextName();
-
+
/**
- *
- * @param servletName
- * @param urlPatterns
+ * Add the specified servlet to the context
+ * @param servletName servlet's name
+ * @param className class name of servlet
+ * @throws IllegalArgumentException duplicate servletName
+ * @throws IllegalStateException this method called after #initialize
+ * @return ServletRegistration allowing configuration of the servlet
+ *
* @since 3.0
*/
- public void addServletMapping(String servletName, String[] urlPatterns);
+ ServletRegistration addServlet(String servletName,
+ String className) throws IllegalArgumentException, IllegalStateException;
/**
- *
- * @param filterName
- * @param description
- * @param className
- * @param initParameters
- * @param isAsyncSupported
+ * Fish out the servlet registration for a named servlet
+ * @param servletName name of the servlet you want to configure
+ * @return ServletRegistration for servlet you want
+ *
* @since 3.0
*/
- public void addFilter(String filterName, String description,
- String className, Map<String,String> initParameters,
- boolean isAsyncSupported);
-
+ ServletRegistration findServletRegistration(String servletName);
+
/**
- *
- * @param filterName
- * @param dispatcherTypes
- * @param isMatchAfter
- * @param servletNames
+ * Add a filter to this context
+ * @param filterName name of filter
+ * @param className class name of filter
+ * @throws IllegalArgumentException duplicate filter name
+ * @throws IllegalStateException if called after #initialise
+ * @return FilterRegistration allowing configuration of filter
+ *
* @since 3.0
*/
- public void addFilterMappingForServletNames(String filterName,
- EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter,
- String... servletNames);
-
+ FilterRegistration addFilter(String filterName,
+ String className) throws IllegalArgumentException, IllegalStateException;
+
/**
- *
- * @param filterName
- * @param dispatcherTypes
- * @param isMatchAfter
- * @param urlPatterns
+ *
+ * @param filterName Name of filter you want to configure
+ * @return FilterRegistration allowing configuration of filter
+ *
* @since 3.0
*/
- public void addFilterMappingForUrlPatterns(String filterName,
- EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter,
- String... urlPatterns);
-
+ FilterRegistration findFilterRegistration(String filterName);
+
/**
- *
- * @param sessionCookieConfig
+ *
+ * @param sessionCookieConfig configuration of session cookie
+ *
* @since 3.0
*/
- public void setSessionCookieConfig(SessionCookieConfig sessionCookieConfig);
-
+ void setSessionCookieConfig(SessionCookieConfig sessionCookieConfig);
+
/**
- *
- * @return
+ *
+ * @return configuration of session cookie
+ *
* @since 3.0
*/
- public SessionCookieConfig getSessionCookieConfig();
+ SessionCookieConfig getSessionCookieConfig();
/**
- *
- * @param sessionTrackingModes
+ *
+ * @param sessionTrackingModes set of SessionTrackingModes for this web app
+ *
* @since 3.0
*/
- public void setSessionTrackingModes(
- EnumSet<SessionTrackingMode> sessionTrackingModes);
-
+ void setSessionTrackingModes(EnumSet<SessionTrackingMode> sessionTrackingModes);
+
/**
- *
- * @return
+ *
+ * @return the default session tracking modes
+ *
* @since 3.0
*/
- public EnumSet<SessionTrackingMode> getDefaultSessionTrackingModes();
-
+ EnumSet<SessionTrackingMode> getDefaultSessionTrackingModes();
+
/**
- *
- * @return
+ *
+ * @return the actual session tracking modes. These will be the default ones unless they've been explicitly set.
+ *
* @since 3.0
*/
- public EnumSet<SessionTrackingMode> getEffectiveSessionTrackingModes();
+ EnumSet<SessionTrackingMode> getEffectiveSessionTrackingModes();
+
+
+
}
Modified: trunk/java/javax/servlet/ServletContextAttributeEvent.java
===================================================================
--- trunk/java/javax/servlet/ServletContextAttributeEvent.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/ServletContextAttributeEvent.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet;
Modified: trunk/java/javax/servlet/ServletContextAttributeListener.java
===================================================================
--- trunk/java/javax/servlet/ServletContextAttributeListener.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/ServletContextAttributeListener.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet;
import java.util.EventListener;
Modified: trunk/java/javax/servlet/ServletContextEvent.java
===================================================================
--- trunk/java/javax/servlet/ServletContextEvent.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/ServletContextEvent.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet;
Modified: trunk/java/javax/servlet/ServletContextListener.java
===================================================================
--- trunk/java/javax/servlet/ServletContextListener.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/ServletContextListener.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet;
import java.util.EventListener;
Modified: trunk/java/javax/servlet/ServletException.java
===================================================================
--- trunk/java/javax/servlet/ServletException.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/ServletException.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet;
Modified: trunk/java/javax/servlet/ServletInputStream.java
===================================================================
--- trunk/java/javax/servlet/ServletInputStream.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/ServletInputStream.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet;
import java.io.InputStream;
Modified: trunk/java/javax/servlet/ServletOutputStream.java
===================================================================
--- trunk/java/javax/servlet/ServletOutputStream.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/ServletOutputStream.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet;
import java.io.OutputStream;
Added: trunk/java/javax/servlet/ServletRegistration.java
===================================================================
--- trunk/java/javax/servlet/ServletRegistration.java (rev 0)
+++ trunk/java/javax/servlet/ServletRegistration.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package javax.servlet;
+
+import java.util.Map;
+
+/**
+ * @version $Rev: 743426 $ $Date: 2009-02-11 18:52:39 +0100 (Wed, 11 Feb 2009) $
+ * @since 3.0
+ */
+public abstract class ServletRegistration {
+
+ protected String description;
+ protected boolean isAsyncSupported;
+ protected int loadOnStartup;
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public void setAsyncSupported(boolean asyncSupported) {
+ isAsyncSupported = asyncSupported;
+ }
+
+ public void setLoadOnStartup(int loadOnStartup) {
+ this.loadOnStartup = loadOnStartup;
+ }
+
+ public abstract void addMapping(String... urlPatterns);
+
+ public abstract void setInitParameter(String name, String value);
+
+ public abstract void setInitParameters(Map<String, String> initParameters);
+
+}
Modified: trunk/java/javax/servlet/ServletRequest.java
===================================================================
--- trunk/java/javax/servlet/ServletRequest.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/ServletRequest.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet;
import java.io.BufferedReader;
@@ -44,9 +47,6 @@
public interface ServletRequest {
-
-
-
/**
*
* Returns the value of the named attribute as an <code>Object</code>,
@@ -91,7 +91,7 @@
*
*/
- public Enumeration<String> getAttributeNames();
+ public Enumeration getAttributeNames();
@@ -229,7 +229,7 @@
*
*/
- public Enumeration<String> getParameterNames();
+ public Enumeration getParameterNames();
@@ -266,7 +266,7 @@
*
*/
- public Map<String,String[]> getParameterMap();
+ public Map getParameterMap();
@@ -343,7 +343,7 @@
* @return a <code>BufferedReader</code>
* containing the body of the request
*
- * @exception UnsupportedEncodingException if the character set encoding
+ * @exception java.io.UnsupportedEncodingException if the character set encoding
* used is not supported and the
* text cannot be decoded
*
@@ -480,7 +480,7 @@
*
*/
- public Enumeration<Locale> getLocales();
+ public Enumeration getLocales();
@@ -595,75 +595,98 @@
public int getLocalPort();
/**
- *
- * @return
+ * Get the servlet context the request-response pair was last dispatched through.
+ * @return the latest ServletContext on the dispatch chain.
* @since 3.0
*/
- public ServletContext getServletContext();
-
+ ServletContext getServletContext();
+
/**
- *
- * @return
- * @throws java.lang.IllegalStateException
+ * Gets the associated servlet response.
+ * @return the ServletResponse associated with this request.
* @since 3.0
*/
- public AsyncContext startAsync() throws java.lang.IllegalStateException;
+ ServletResponse getServletResponse();
+
+ void addAsyncListener(AsyncListener listener);
- /**
- *
- * @param servletRequest
- * @param servletResponse
- * @return
- * @throws java.lang.IllegalStateException
- * @since 3.0
- */
- public AsyncContext startAsync(ServletRequest servletRequest,
- ServletResponse servletResponse)
- throws java.lang.IllegalStateException;
-
- /**
- *
- * @return
- * @since 3.0
- */
- public boolean isAsyncStarted();
-
- /**
- *
- * @return
- * @since 3.0
- */
- public boolean isAsyncSupported();
-
- /**
- *
- * @return
- * @since 3.0
- */
- public AsyncContext getAsyncContext();
+ void addAsyncListener(AsyncListener listener, ServletRequest request, ServletResponse response);
- /**
- *
- * @param listener
- * @since 3.0
- */
- public void addAsyncListener(AsyncListener listener);
-
- /**
- *
- * @param listener
- * @param servletRequest
- * @param servletResponse
- * @since 3.0
- */
- public void addAsyncListener(AsyncListener listener,
- ServletRequest servletRequest, ServletResponse servletResponse);
-
- /**
- *
- * @param timeout
- * @since 3.0
- */
- public void setAsyncTimeout(long timeout);
+ AsyncContext getAsyncContext();
+
+ boolean isAsyncStarted();
+
+ boolean isAsyncSupported();
+
+ void setAsyncTimeout(long timeout);
+
+ AsyncContext startAsync();
+
+ AsyncContext startAsync(ServletRequest request, ServletResponse response);
+
+ DispatcherType getDispatcherType();
+
+
+// /**
+// * complete a suspended request.
+// * @throws IllegalStateException
+// * @since 3.0
+// */
+// void complete() throws IllegalStateException;
+//
+// /**
+// * Suspend request processing. Must be called by a thread that is processing this request.
+// * @param timeoutMilliseconds new timeout period, in milliseconds
+// * @throws IllegalStateException if called by a thread not processing this request or after error dispatch
+// * @since 3.0
+// * @see #complete
+// * @see #resume
+// */
+// void suspend(long timeoutMilliseconds) throws IllegalStateException;
+//
+// /**
+// * Similar to suspend(timeoutMilliseconds) but with a container supplied timeout period.
+// * @throws IllegalStateException
+// * @since 3.0
+// * @see #complete
+// * @see #resume
+// */
+// void suspend() throws IllegalStateException;
+//
+// /**
+// * Resume a suspended request
+// * @throws IllegalStateException if the request is not suspended
+// * @since 3.0
+// * @see #suspend
+// */
+// void resume() throws IllegalStateException;
+//
+// /**
+// *
+// * @return if the request is suspended
+// * @since 3.0
+// */
+// boolean isSuspended();
+//
+// /**
+// *
+// * @return if the request is resumed
+// * @since 3.0
+// */
+// boolean isResumed();
+//
+// /**
+// *
+// * @return if the request is timed out
+// * @since 3.0
+// */
+// boolean isTimeout();
+//
+// /**
+// *
+// * @return if the request has never been suspended (or resumed)
+// * @since 3.0
+// */
+// boolean isInitial();
}
Modified: trunk/java/javax/servlet/ServletRequestAttributeEvent.java
===================================================================
--- trunk/java/javax/servlet/ServletRequestAttributeEvent.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/ServletRequestAttributeEvent.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet;
Modified: trunk/java/javax/servlet/ServletRequestAttributeListener.java
===================================================================
--- trunk/java/javax/servlet/ServletRequestAttributeListener.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/ServletRequestAttributeListener.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet;
import java.util.EventListener;
Modified: trunk/java/javax/servlet/ServletRequestEvent.java
===================================================================
--- trunk/java/javax/servlet/ServletRequestEvent.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/ServletRequestEvent.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet;
Modified: trunk/java/javax/servlet/ServletRequestListener.java
===================================================================
--- trunk/java/javax/servlet/ServletRequestListener.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/ServletRequestListener.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,40 +1,72 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet;
import java.util.EventListener;
+/**
+ * A ServletRequestListener can be implemented by the developer
+ * interested in being notified of requests coming in and out of
+ * scope in a web component. A request is defined as coming into
+ * scope when it is about to enter the first servlet or filter
+ * in each web application, as going out of scope when it exits
+ * the last servlet or the first filter in the chain.
+ *
+ * @since Servlet 2.4
+ */
+
+
+public interface ServletRequestListener extends EventListener {
+
/**
- * A ServletRequestListener can be implemented by the developer
- * interested in being notified of requests coming in and out of
- * scope in a web component. A request is defined as coming into
- * scope when it is about to enter the first servlet or filter
- * in each web application, as going out of scope when it exits
- * the last servlet or the first filter in the chain.
+ * The request is about to go out of scope of the web application.
*
- * @since Servlet 2.4
+ * @param sre event containing request
*/
+ public void requestDestroyed(ServletRequestEvent sre);
+ /**
+ * The request is about to come into scope of the web application.
+ *
+ * @param sre event containing request
+ */
+ public void requestInitialized(ServletRequestEvent sre);
-public interface ServletRequestListener extends EventListener {
+ /**
+ * Called after suspend
+ * @param sre event containing request
+ * @since 3.0
+ */
+ void requestSuspended(ServletRequestEvent sre);
- /** The request is about to go out of scope of the web application. */
- public void requestDestroyed ( ServletRequestEvent sre );
+ /**
+ * called before resume
+ * @param sre event containing request
+ * @since 3.0
+ */
+ void requestResumed(ServletRequestEvent sre);
- /** The request is about to come into scope of the web application. */
- public void requestInitialized ( ServletRequestEvent sre );
+ /**
+ * called after completion
+ * @param sre event containing request
+ * @since 3.0
+ */
+ void requestCompleted(ServletRequestEvent sre);
}
Modified: trunk/java/javax/servlet/ServletRequestWrapper.java
===================================================================
--- trunk/java/javax/servlet/ServletRequestWrapper.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/ServletRequestWrapper.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet;
import java.io.BufferedReader;
@@ -89,7 +92,7 @@
* on the wrapped request object.
*/
- public Enumeration<String> getAttributeNames() {
+ public Enumeration getAttributeNames() {
return this.request.getAttributeNames();
}
@@ -162,7 +165,7 @@
* The default behavior of this method is to return getParameterMap()
* on the wrapped request object.
*/
- public Map<String,String[]> getParameterMap() {
+ public Map getParameterMap() {
return this.request.getParameterMap();
}
@@ -174,7 +177,7 @@
* on the wrapped request object.
*/
- public Enumeration<String> getParameterNames() {
+ public Enumeration getParameterNames() {
return this.request.getParameterNames();
}
@@ -315,7 +318,7 @@
* on the wrapped request object.
*/
- public Enumeration<Locale> getLocales() {
+ public Enumeration getLocales() {
return this.request.getLocales();
}
@@ -349,7 +352,6 @@
/**
* The default behavior of this method is to return getRealPath(String path)
* on the wrapped request object.
- * @deprecated As of Version 3.0 of the Java Servlet API
*/
public String getRealPath(String path) {
@@ -399,114 +401,138 @@
}
/**
- * The default behavior of this method is to return
- * getServletContext() on the wrapped request object.
- *
- * @return
+ * Get the servlet context the request-response pair was last dispatched through.
+ *
+ * @return the latest ServletContext on the dispatch chain.
* @since 3.0
*/
public ServletContext getServletContext() {
return request.getServletContext();
}
-
+
/**
- * The default behavior of this method is to return
- * startAsync() on the wrapped request object.
- *
- * @return
- * @throws java.lang.IllegalStateException
+ * Gets the associated servlet response.
+ *
+ * @return the ServletResponse associated with this request.
* @since 3.0
*/
- public AsyncContext startAsync() throws java.lang.IllegalStateException {
- return request.startAsync();
+ public ServletResponse getServletResponse() {
+ return request.getServletResponse();
}
-
- /**
- * The default behavior of this method is to return
- * startAsync(ServletRequest, ServletResponse) on the wrapped request
- * object.
- *
- * @param servletRequest
- * @param servletResponse
- * @return
- * @throws java.lang.IllegalStateException
- * @since 3.0
- */
- public AsyncContext startAsync(ServletRequest servletRequest,
- ServletResponse servletResponse)
- throws java.lang.IllegalStateException {
- return request.startAsync(servletRequest, servletResponse);
+
+ public void addAsyncListener(AsyncListener listener) {
+ request.addAsyncListener(listener);
}
-
- /**
- * The default behavior of this method is to return
- * isAsyncStarted() on the wrapped request object.
- *
- * @return
- * @since 3.0
- */
+
+ public void addAsyncListener(AsyncListener listener, ServletRequest request, ServletResponse response) {
+ request.addAsyncListener(listener, request, response);
+ }
+
+ public AsyncContext getAsyncContext() {
+ return request.getAsyncContext();
+ }
+
public boolean isAsyncStarted() {
return request.isAsyncStarted();
}
-
- /**
- * The default behavior of this method is to return
- * isAsyncSupported() on the wrapped request object.
- *
- * @return
- * @since 3.0
- */
+
public boolean isAsyncSupported() {
return request.isAsyncSupported();
}
-
- /**
- * The default behavior of this method is to return
- * getAsyncContext() on the wrapped request object.
- *
- * @return
- * @since 3.0
- */
- public AsyncContext getAsyncContext() {
- return request.getAsyncContext();
+
+ public void setAsyncTimeout(long timeout) {
+ request.setAsyncTimeout(timeout);
}
- /**
- * The default behavior of this method is to call
- * addAsyncListener(AsyncListener) on the wrapped request object.
- *
- * @param listener
- * @since 3.0
- */
- public void addAsyncListener(AsyncListener listener) {
- request.addAsyncListener(listener);
+ public AsyncContext startAsync() {
+ return request.startAsync();
}
-
- /**
- * The default behavior of this method is to call
- * addAsyncListener(AsyncListener, ServletRequest, ServletResponse) on the
- * wrapped request object.
- *
- * @param listener
- * @param servletRequest
- * @param servletResponse
- * @since 3.0
- */
- public void addAsyncListener(AsyncListener listener,
- ServletRequest servletRequest, ServletResponse servletResponse) {
- addAsyncListener(listener, servletRequest, servletResponse);
+
+ public AsyncContext startAsync(ServletRequest request, ServletResponse response) {
+ return request.startAsync(request, response);
}
-
- /**
- * The default behavior of this method is to call
- * startAsync() on the wrapped request object.
- *
- * @param timeout
- * @since 3.0
- */
- public void setAsyncTimeout(long timeout) {
- request.setAsyncTimeout(timeout);
+
+ public DispatcherType getDispatcherType() {
+ return request.getDispatcherType();
}
+// /**
+// * complete a suspended request.
+// *
+// * @throws IllegalStateException
+// * @since 3.0
+// */
+// public void complete() throws IllegalStateException {
+// request.complete();
+// }
+//
+// /**
+// * Suspend request processing. Must be called by a thread that is processing this request.
+// *
+// * @param timeoutMilliseconds new timeout period, in milliseconds
+// * @throws IllegalStateException if called by a thread not processing this request or after error dispatch
+// * @see #complete
+// * @see #resume
+// * @since 3.0
+// */
+// public void suspend(long timeoutMilliseconds) throws IllegalStateException {
+// request.suspend(timeoutMilliseconds);
+// }
+//
+// /**
+// * Similar to suspend(timeoutMilliseconds) but with a container supplied timeout period.
+// *
+// * @throws IllegalStateException
+// * @see #complete
+// * @see #resume
+// * @since 3.0
+// */
+// public void suspend() throws IllegalStateException {
+// request.suspend();
+// }
+//
+// /**
+// * Resume a suspended request
+// *
+// * @throws IllegalStateException if the request is not suspended
+// * @see #suspend
+// * @since 3.0
+// */
+// public void resume() throws IllegalStateException {
+// request.resume();
+// }
+//
+// /**
+// * @return if the request is suspended
+// * @since 3.0
+// */
+// public boolean isSuspended() {
+// return request.isSuspended();
+// }
+//
+// /**
+// * @return if the request is resumed
+// * @since 3.0
+// */
+// public boolean isResumed() {
+// return request.isResumed();
+// }
+//
+// /**
+// * @return if the request is timed out
+// * @since 3.0
+// */
+// public boolean isTimeout() {
+// return request.isTimeout();
+// }
+//
+// /**
+// * @return if the request has never been suspended (or resumed)
+// * @since 3.0
+// */
+// public boolean isInitial() {
+// return request.isInitial();
+// }
+
}
Modified: trunk/java/javax/servlet/ServletResponse.java
===================================================================
--- trunk/java/javax/servlet/ServletResponse.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/ServletResponse.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet;
import java.io.IOException;
@@ -156,7 +159,7 @@
* @return a <code>PrintWriter</code> object that
* can return character data to the client
*
- * @exception UnsupportedEncodingException
+ * @exception java.io.UnsupportedEncodingException
* if the character encoding returned
* by <code>getCharacterEncoding</code> cannot be used
*
@@ -437,14 +440,31 @@
* have no effect. If no locale has been specified,
* the container's default locale is returned.
*
+ * @return locale specified for this response
* @see #setLocale
- *
*/
public Locale getLocale();
+ /**
+ * Helper for suspend/resume: disables output
+ * @since 3.0
+ */
+ void disable();
+ /**
+ * Helper for suspend/resume: enables output
+ * @since 3.0
+ */
+ void enable();
+ /**
+ * Helper for suspend/resume, shows disabled state
+ * @return true if disable is most recent disable/enable call
+ * @since 3.0
+ */
+ boolean isDisabled();
+
}
Modified: trunk/java/javax/servlet/ServletResponseWrapper.java
===================================================================
--- trunk/java/javax/servlet/ServletResponseWrapper.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/ServletResponseWrapper.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet;
import java.io.IOException;
@@ -209,7 +212,35 @@
return this.response.getLocale();
}
+ /**
+ * Helper for suspend/resume: disables output
+ *
+ * @since 3.0
+ */
+ public void disable() {
+ response.disable();
+ }
+ /**
+ * Helper for suspend/resume: enables output
+ *
+ * @since 3.0
+ */
+ public void enable() {
+ response.enable();
+ }
+
+ /**
+ * Helper for suspend/resume, shows disabled state
+ *
+ * @return true if disable is most recent disable/enable call
+ * @since 3.0
+ */
+ public boolean isDisabled() {
+ return response.isDisabled();
+ }
+
+
}
Modified: trunk/java/javax/servlet/SessionCookieConfig.java
===================================================================
--- trunk/java/javax/servlet/SessionCookieConfig.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/SessionCookieConfig.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,77 +1,61 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
+
+
package javax.servlet;
/**
- *
+ * @version $Rev: 675701 $ $Date: 2008-07-10 21:49:52 +0200 (Thu, 10 Jul 2008) $
* @since 3.0
- * $Id: SessionCookieConfig.java 733271 2009-01-10 13:37:33Z markt $
*/
public class SessionCookieConfig {
- private String domain;
- private String path;
- private String comment;
- private boolean httpOnly;
- private boolean secure;
- /**
- *
- * @param domain Domain to use for session cookies generated for a
- * {@link ServletContext} in which this
- * {@link SessionCookieConfig} has been set
- * @param path Path to use for session cookies generated for a
- * {@link ServletContext} in which this
- * {@link SessionCookieConfig} has been set. If null
- * {@link ServletContext#getContextPath()} is used
- * @param comment Comment to use for session cookies generated for a
- * {@link ServletContext} in which this
- * {@link SessionCookieConfig} has been set
- * @param isHttpOnly HttpOnly flag to use for session cookies generated for
- * a {@link ServletContext} in which this
- * {@link SessionCookieConfig} has been set
- * @param isSecure If <code>true</code>, the cookie will always be marked
- * as secure. If <code>false</code> the cookie will only
- * be marked as secure if the request is secure.
- */
- public SessionCookieConfig(String domain, String path, String comment,
- boolean isHttpOnly, boolean isSecure) {
+ private final String domain;
+ private final String path;
+ private final String comment;
+ private final boolean httpOnly;
+ private final boolean secure;
+
+ public SessionCookieConfig(String domain, String path, String comment, boolean httpOnly, boolean secure) {
this.domain = domain;
this.path = path;
this.comment = comment;
- this.httpOnly = isHttpOnly;
- this.secure = isSecure;
+ this.httpOnly = httpOnly;
+ this.secure = secure;
}
-
- public java.lang.String getDomain() {
+
+ public String getDomain() {
return domain;
}
-
- public java.lang.String getPath() {
+
+ public String getPath() {
return path;
}
-
- public java.lang.String getComment() {
+
+ public String getComment() {
return comment;
}
-
+
public boolean isHttpOnly() {
return httpOnly;
}
-
+
public boolean isSecure() {
return secure;
}
Modified: trunk/java/javax/servlet/SessionTrackingMode.java
===================================================================
--- trunk/java/javax/servlet/SessionTrackingMode.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/SessionTrackingMode.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,27 +1,33 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
package javax.servlet;
/**
+ * @version $Rev: 675701 $ $Date: 2008-07-10 21:49:52 +0200 (Thu, 10 Jul 2008) $
* @since 3.0
- * $Id: SessionTrackingMode.java 734696 2009-01-15 13:24:26Z markt $
*/
public enum SessionTrackingMode {
+
COOKIE,
- URL,
- SSL
+ SSL,
+ URL
+
}
Modified: trunk/java/javax/servlet/SingleThreadModel.java
===================================================================
--- trunk/java/javax/servlet/SingleThreadModel.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/SingleThreadModel.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet;
/**
Modified: trunk/java/javax/servlet/UnavailableException.java
===================================================================
--- trunk/java/javax/servlet/UnavailableException.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/UnavailableException.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,23 +1,24 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package javax.servlet;
-
/**
* Defines an exception that a servlet or filter throws to indicate
* that it is permanently or temporarily unavailable.
Modified: trunk/java/javax/servlet/http/Cookie.java
===================================================================
--- trunk/java/javax/servlet/http/Cookie.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/http/Cookie.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet.http;
import java.text.MessageFormat;
@@ -81,16 +84,16 @@
// Attributes encoded in the header's cookie fields.
//
- private String comment; // ;Comment=VALUE ... describes cookie's use
- // ;Discard ... implied by maxAge < 0
- private String domain; // ;Domain=VALUE ... domain that sees cookie
- private int maxAge = -1; // ;Max-Age=VALUE ... cookies auto-expire
- private String path; // ;Path=VALUE ... URLs that see the cookie
- private boolean secure; // ;Secure ... e.g. use SSL
- private int version = 0; // ;Version=1 ... means RFC 2109++ style
- private boolean httpOnly; // Not in cookie specs, but supported by browsers
-
+ private String comment; // ;Comment=VALUE ... describes cookie's use
+ // ;Discard ... implied by maxAge < 0
+ private String domain; // ;Domain=VALUE ... domain that sees cookie
+ private int maxAge = -1; // ;Max-Age=VALUE ... cookies auto-expire
+ private String path; // ;Path=VALUE ... URLs that see the cookie
+ private boolean secure; // ;Secure ... e.g. use SSL
+ private int version = 0; // ;Version=1 ... means RFC 2109++ style
+ private boolean httpOnly;
+
/**
* Constructs a cookie with a specified name and value.
*
@@ -535,18 +538,18 @@
}
/**
- *
- * @return
- * @since 3.0
+ *
+ * @return whether cookie is http only
+ * @since servlet 3.0
*/
public boolean isHttpOnly() {
return httpOnly;
}
/**
- *
- * @param httpOnly
- * since 3.0
+ *
+ * @param httpOnly httpOnly setting
+ * @since servlet 3.0
*/
public void setHttpOnly(boolean httpOnly) {
this.httpOnly = httpOnly;
Modified: trunk/java/javax/servlet/http/HttpServlet.java
===================================================================
--- trunk/java/javax/servlet/http/HttpServlet.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/http/HttpServlet.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
*/
+
package javax.servlet.http;
import java.io.IOException;
@@ -23,6 +26,7 @@
import java.lang.reflect.Method;
import java.text.MessageFormat;
import java.util.Enumeration;
+import java.util.Locale;
import java.util.ResourceBundle;
import javax.servlet.GenericServlet;
@@ -33,6 +37,7 @@
/**
+ *
* Provides an abstract class to be subclassed to create
* an HTTP servlet suitable for a Web site. A subclass of
* <code>HttpServlet</code> must override at least
@@ -70,12 +75,16 @@
* Java Tutorial on Multithreaded Programming</a> for more
* information on handling multiple threads in a Java program.
*
- * @author Various
- * @version $Version$
+ * @author Various
+ * @version $Version$
+ *
*/
+
+
+
public abstract class HttpServlet extends GenericServlet
- implements java.io.Serializable {
-
+ implements java.io.Serializable
+{
private static final String METHOD_DELETE = "DELETE";
private static final String METHOD_HEAD = "HEAD";
private static final String METHOD_GET = "GET";
@@ -88,18 +97,24 @@
private static final String HEADER_LASTMOD = "Last-Modified";
private static final String LSTRING_FILE =
- "javax.servlet.http.LocalStrings";
+ "javax.servlet.http.LocalStrings";
private static ResourceBundle lStrings =
- ResourceBundle.getBundle(LSTRING_FILE);
+ ResourceBundle.getBundle(LSTRING_FILE);
+
+
/**
* Does nothing, because this is an abstract class.
+ *
*/
+
public HttpServlet() { }
+
/**
+ *
* Called by the server (via the <code>service</code> method) to
* allow a servlet to handle a GET request.
*
@@ -145,38 +160,46 @@
*
* <p>If the request is incorrectly formatted, <code>doGet</code>
* returns an HTTP "Bad Request" message.
+ *
*
- * @param req an {@link HttpServletRequest} object that
- * contains the request the client has made
- * of the servlet
+ * @param req an {@link HttpServletRequest} object that
+ * contains the request the client has made
+ * of the servlet
*
- * @param resp an {@link HttpServletResponse} object that
- * contains the response the servlet sends
- * to the client
+ * @param resp an {@link HttpServletResponse} object that
+ * contains the response the servlet sends
+ * to the client
*
- * @exception IOException if an input or output error is
- * detected when the servlet handles
- * the GET request
+ * @exception IOException if an input or output error is
+ * detected when the servlet handles
+ * the GET request
*
- * @exception ServletException if the request for the GET
- * could not be handled
+ * @exception ServletException if the request for the GET
+ * could not be handled
+ *
*
* @see javax.servlet.ServletResponse#setContentType
+ *
*/
+
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
- throws ServletException, IOException
+ throws ServletException, IOException
{
- String protocol = req.getProtocol();
- String msg = lStrings.getString("http.method_get_not_supported");
- if (protocol.endsWith("1.1")) {
- resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, msg);
- } else {
- resp.sendError(HttpServletResponse.SC_BAD_REQUEST, msg);
- }
+ String protocol = req.getProtocol();
+ String msg = lStrings.getString("http.method_get_not_supported");
+ if (protocol.endsWith("1.1")) {
+ resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, msg);
+ } else {
+ resp.sendError(HttpServletResponse.SC_BAD_REQUEST, msg);
+ }
}
+
+
+
/**
+ *
* Returns the time the <code>HttpServletRequest</code>
* object was last modified,
* in milliseconds since midnight January 1, 1970 GMT.
@@ -188,21 +211,28 @@
* This makes browser and proxy caches work more effectively,
* reducing the load on server and network resources.
*
- * @param req the <code>HttpServletRequest</code>
- * object that is sent to the servlet
*
- * @return a <code>long</code> integer specifying
- * the time the <code>HttpServletRequest</code>
- * object was last modified, in milliseconds
- * since midnight, January 1, 1970 GMT, or
- * -1 if the time is not known
+ * @param req the <code>HttpServletRequest</code>
+ * object that is sent to the servlet
+ *
+ * @return a <code>long</code> integer specifying
+ * the time the <code>HttpServletRequest</code>
+ * object was last modified, in milliseconds
+ * since midnight, January 1, 1970 GMT, or
+ * -1 if the time is not known
+ *
*/
+
protected long getLastModified(HttpServletRequest req) {
- return -1;
+ return -1;
}
+
+
/**
+ *
+ *
* <p>Receives an HTTP HEAD request from the protected
* <code>service</code> method and handles the
* request.
@@ -223,27 +253,34 @@
* <code>doHead</code> returns an HTTP "Bad Request"
* message.
*
- * @param req the request object that is passed to the servlet
*
- * @param resp the response object that the servlet
- * uses to return the headers to the clien
+ * @param req the request object that is passed
+ * to the servlet
+ *
+ * @param resp the response object that the servlet
+ * uses to return the headers to the clien
*
- * @exception IOException if an input or output error occurs
+ * @exception IOException if an input or output error occurs
*
- * @exception ServletException if the request for the HEAD
- * could not be handled
+ * @exception ServletException if the request for the HEAD
+ * could not be handled
*/
+
protected void doHead(HttpServletRequest req, HttpServletResponse resp)
- throws ServletException, IOException {
+ throws ServletException, IOException
+ {
+ NoBodyResponse response = new NoBodyResponse(resp);
+
+ doGet(req, response);
+ response.setContentLength();
+ }
+
- NoBodyResponse response = new NoBodyResponse(resp);
- doGet(req, response);
- response.setContentLength();
- }
/**
+ *
* Called by the server (via the <code>service</code> method)
* to allow a servlet to handle a POST request.
*
@@ -282,37 +319,43 @@
* <code>doPost</code> returns an HTTP "Bad Request" message.
*
*
- * @param req an {@link HttpServletRequest} object that
- * contains the request the client has made
- * of the servlet
+ * @param req an {@link HttpServletRequest} object that
+ * contains the request the client has made
+ * of the servlet
*
- * @param resp an {@link HttpServletResponse} object that
- * contains the response the servlet sends
- * to the client
+ * @param resp an {@link HttpServletResponse} object that
+ * contains the response the servlet sends
+ * to the client
*
- * @exception IOException if an input or output error is
- * detected when the servlet handles
- * the request
+ * @exception IOException if an input or output error is
+ * detected when the servlet handles
+ * the request
*
- * @exception ServletException if the request for the POST
- * could not be handled
+ * @exception ServletException if the request for the POST
+ * could not be handled
*
+ *
* @see javax.servlet.ServletOutputStream
* @see javax.servlet.ServletResponse#setContentType
+ *
+ *
*/
+
protected void doPost(HttpServletRequest req, HttpServletResponse resp)
- throws ServletException, IOException {
-
- String protocol = req.getProtocol();
- String msg = lStrings.getString("http.method_post_not_supported");
- if (protocol.endsWith("1.1")) {
- resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, msg);
- } else {
- resp.sendError(HttpServletResponse.SC_BAD_REQUEST, msg);
- }
+ throws ServletException, IOException
+ {
+ String protocol = req.getProtocol();
+ String msg = lStrings.getString("http.method_post_not_supported");
+ if (protocol.endsWith("1.1")) {
+ resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, msg);
+ } else {
+ resp.sendError(HttpServletResponse.SC_BAD_REQUEST, msg);
+ }
}
+
+
/**
* Called by the server (via the <code>service</code> method)
* to allow a servlet to handle a PUT request.
@@ -340,35 +383,41 @@
* <p>If the HTTP PUT request is incorrectly formatted,
* <code>doPut</code> returns an HTTP "Bad Request" message.
*
- * @param req the {@link HttpServletRequest} object that
- * contains the request the client made of
- * the servlet
*
- * @param resp the {@link HttpServletResponse} object that
- * contains the response the servlet returns
- * to the client
+ * @param req the {@link HttpServletRequest} object that
+ * contains the request the client made of
+ * the servlet
*
- * @exception IOException if an input or output error occurs
- * while the servlet is handling the
- * PUT request
+ * @param resp the {@link HttpServletResponse} object that
+ * contains the response the servlet returns
+ * to the client
*
- * @exception ServletException if the request for the PUT
- * cannot be handled
+ * @exception IOException if an input or output error occurs
+ * while the servlet is handling the
+ * PUT request
+ *
+ * @exception ServletException if the request for the PUT
+ * cannot be handled
+ *
*/
+
protected void doPut(HttpServletRequest req, HttpServletResponse resp)
- throws ServletException, IOException {
-
- String protocol = req.getProtocol();
- String msg = lStrings.getString("http.method_put_not_supported");
- if (protocol.endsWith("1.1")) {
- resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, msg);
- } else {
- resp.sendError(HttpServletResponse.SC_BAD_REQUEST, msg);
- }
+ throws ServletException, IOException
+ {
+ String protocol = req.getProtocol();
+ String msg = lStrings.getString("http.method_put_not_supported");
+ if (protocol.endsWith("1.1")) {
+ resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, msg);
+ } else {
+ resp.sendError(HttpServletResponse.SC_BAD_REQUEST, msg);
+ }
}
+
+
/**
+ *
* Called by the server (via the <code>service</code> method)
* to allow a servlet to handle a DELETE request.
*
@@ -386,37 +435,41 @@
* <code>doDelete</code> returns an HTTP "Bad Request"
* message.
*
- * @param req the {@link HttpServletRequest} object that
- * contains the request the client made of
- * the servlet
*
+ * @param req the {@link HttpServletRequest} object that
+ * contains the request the client made of
+ * the servlet
*
- * @param resp the {@link HttpServletResponse} object that
- * contains the response the servlet returns
- * to the client
*
- * @exception IOException if an input or output error occurs
- * while the servlet is handling the
- * DELETE request
+ * @param resp the {@link HttpServletResponse} object that
+ * contains the response the servlet returns
+ * to the client
*
- * @exception ServletException if the request for the
- * DELETE cannot be handled
+ *
+ * @exception IOException if an input or output error occurs
+ * while the servlet is handling the
+ * DELETE request
+ *
+ * @exception ServletException if the request for the
+ * DELETE cannot be handled
+ *
*/
+
protected void doDelete(HttpServletRequest req,
- HttpServletResponse resp)
- throws ServletException, IOException {
-
- String protocol = req.getProtocol();
- String msg = lStrings.getString("http.method_delete_not_supported");
- if (protocol.endsWith("1.1")) {
- resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, msg);
- } else {
- resp.sendError(HttpServletResponse.SC_BAD_REQUEST, msg);
- }
+ HttpServletResponse resp)
+ throws ServletException, IOException
+ {
+ String protocol = req.getProtocol();
+ String msg = lStrings.getString("http.method_delete_not_supported");
+ if (protocol.endsWith("1.1")) {
+ resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, msg);
+ } else {
+ resp.sendError(HttpServletResponse.SC_BAD_REQUEST, msg);
+ }
}
- private static Method[] getAllDeclaredMethods(Class<?> c) {
+ private static Method[] getAllDeclaredMethods(Class c) {
if (c.equals(javax.servlet.http.HttpServlet.class)) {
return null;
@@ -424,19 +477,19 @@
Method[] parentMethods = getAllDeclaredMethods(c.getSuperclass());
Method[] thisMethods = c.getDeclaredMethods();
-
+
if ((parentMethods != null) && (parentMethods.length > 0)) {
Method[] allMethods =
new Method[parentMethods.length + thisMethods.length];
- System.arraycopy(parentMethods, 0, allMethods, 0,
+ System.arraycopy(parentMethods, 0, allMethods, 0,
parentMethods.length);
- System.arraycopy(thisMethods, 0, allMethods, parentMethods.length,
+ System.arraycopy(thisMethods, 0, allMethods, parentMethods.length,
thisMethods.length);
- thisMethods = allMethods;
- }
+ thisMethods = allMethods;
+ }
- return thisMethods;
+ return thisMethods;
}
@@ -456,75 +509,82 @@
* servlet implements new HTTP methods, beyond those
* implemented by HTTP 1.1.
*
- * @param req the {@link HttpServletRequest} object that
- * contains the request the client made of
- * the servlet
+ * @param req the {@link HttpServletRequest} object that
+ * contains the request the client made of
+ * the servlet
*
- * @param resp the {@link HttpServletResponse} object that
- * contains the response the servlet returns
- * to the client
*
- * @exception IOException if an input or output error occurs
- * while the servlet is handling the
- * OPTIONS request
+ * @param resp the {@link HttpServletResponse} object that
+ * contains the response the servlet returns
+ * to the client
*
- * @exception ServletException if the request for the
- * OPTIONS cannot be handled
+ *
+ * @exception IOException if an input or output error occurs
+ * while the servlet is handling the
+ * OPTIONS request
+ *
+ * @exception ServletException if the request for the
+ * OPTIONS cannot be handled
+ *
*/
+
protected void doOptions(HttpServletRequest req, HttpServletResponse resp)
- throws ServletException, IOException {
-
- Method[] methods = getAllDeclaredMethods(this.getClass());
-
- boolean ALLOW_GET = false;
- boolean ALLOW_HEAD = false;
- boolean ALLOW_POST = false;
- boolean ALLOW_PUT = false;
- boolean ALLOW_DELETE = false;
- boolean ALLOW_TRACE = true;
- boolean ALLOW_OPTIONS = true;
-
- for (int i=0; i<methods.length; i++) {
- Method m = methods[i];
-
- if (m.getName().equals("doGet")) {
- ALLOW_GET = true;
- ALLOW_HEAD = true;
- }
- if (m.getName().equals("doPost"))
- ALLOW_POST = true;
- if (m.getName().equals("doPut"))
- ALLOW_PUT = true;
- if (m.getName().equals("doDelete"))
- ALLOW_DELETE = true;
- }
-
- String allow = null;
- if (ALLOW_GET)
- allow=METHOD_GET;
- if (ALLOW_HEAD)
- if (allow==null) allow=METHOD_HEAD;
- else allow += ", " + METHOD_HEAD;
- if (ALLOW_POST)
- if (allow==null) allow=METHOD_POST;
- else allow += ", " + METHOD_POST;
- if (ALLOW_PUT)
- if (allow==null) allow=METHOD_PUT;
- else allow += ", " + METHOD_PUT;
- if (ALLOW_DELETE)
- if (allow==null) allow=METHOD_DELETE;
- else allow += ", " + METHOD_DELETE;
- if (ALLOW_TRACE)
- if (allow==null) allow=METHOD_TRACE;
- else allow += ", " + METHOD_TRACE;
- if (ALLOW_OPTIONS)
- if (allow==null) allow=METHOD_OPTIONS;
- else allow += ", " + METHOD_OPTIONS;
-
- resp.setHeader("Allow", allow);
+ throws ServletException, IOException
+ {
+ Method[] methods = getAllDeclaredMethods(this.getClass());
+
+ boolean ALLOW_GET = false;
+ boolean ALLOW_HEAD = false;
+ boolean ALLOW_POST = false;
+ boolean ALLOW_PUT = false;
+ boolean ALLOW_DELETE = false;
+ boolean ALLOW_TRACE = true;
+ boolean ALLOW_OPTIONS = true;
+
+ for (int i=0; i<methods.length; i++) {
+ Method m = methods[i];
+
+ if (m.getName().equals("doGet")) {
+ ALLOW_GET = true;
+ ALLOW_HEAD = true;
+ }
+ if (m.getName().equals("doPost"))
+ ALLOW_POST = true;
+ if (m.getName().equals("doPut"))
+ ALLOW_PUT = true;
+ if (m.getName().equals("doDelete"))
+ ALLOW_DELETE = true;
+
+ }
+
+ String allow = null;
+ if (ALLOW_GET)
+ if (allow==null) allow=METHOD_GET;
+ if (ALLOW_HEAD)
+ if (allow==null) allow=METHOD_HEAD;
+ else allow += ", " + METHOD_HEAD;
+ if (ALLOW_POST)
+ if (allow==null) allow=METHOD_POST;
+ else allow += ", " + METHOD_POST;
+ if (ALLOW_PUT)
+ if (allow==null) allow=METHOD_PUT;
+ else allow += ", " + METHOD_PUT;
+ if (ALLOW_DELETE)
+ if (allow==null) allow=METHOD_DELETE;
+ else allow += ", " + METHOD_DELETE;
+ if (ALLOW_TRACE)
+ if (allow==null) allow=METHOD_TRACE;
+ else allow += ", " + METHOD_TRACE;
+ if (ALLOW_OPTIONS)
+ if (allow==null) allow=METHOD_OPTIONS;
+ else allow += ", " + METHOD_OPTIONS;
+
+ resp.setHeader("Allow", allow);
}
+
+
/**
* Called by the server (via the <code>service</code> method)
* to allow a servlet to handle a TRACE request.
@@ -533,53 +593,63 @@
* request to the client, so that they can be used in
* debugging. There's no need to override this method.
*
- * @param req the {@link HttpServletRequest} object that
- * contains the request the client made of
- * the servlet
*
- * @param resp the {@link HttpServletResponse} object that
- * contains the response the servlet returns
- * to the client
*
- * @exception IOException if an input or output error occurs
- * while the servlet is handling the
- * TRACE request
+ * @param req the {@link HttpServletRequest} object that
+ * contains the request the client made of
+ * the servlet
*
- * @exception ServletException if the request for the
- * TRACE cannot be handled
+ *
+ * @param resp the {@link HttpServletResponse} object that
+ * contains the response the servlet returns
+ * to the client
+ *
+ *
+ * @exception IOException if an input or output error occurs
+ * while the servlet is handling the
+ * TRACE request
+ *
+ * @exception ServletException if the request for the
+ * TRACE cannot be handled
+ *
*/
+
protected void doTrace(HttpServletRequest req, HttpServletResponse resp)
- throws ServletException, IOException
+ throws ServletException, IOException
{
-
- int responseLength;
-
- String CRLF = "\r\n";
- String responseString = "TRACE "+ req.getRequestURI()+
- " " + req.getProtocol();
-
- Enumeration<String> reqHeaderEnum = req.getHeaderNames();
-
- while( reqHeaderEnum.hasMoreElements() ) {
- String headerName = reqHeaderEnum.nextElement();
- responseString += CRLF + headerName + ": " +
- req.getHeader(headerName);
- }
-
- responseString += CRLF;
-
- responseLength = responseString.length();
-
- resp.setContentType("message/http");
- resp.setContentLength(responseLength);
- ServletOutputStream out = resp.getOutputStream();
- out.print(responseString);
- out.close();
- return;
- }
+
+ int responseLength;
+
+ String CRLF = "\r\n";
+ String responseString = "TRACE "+ req.getRequestURI()+
+ " " + req.getProtocol();
+
+ Enumeration reqHeaderEnum = req.getHeaderNames();
+
+ while( reqHeaderEnum.hasMoreElements() ) {
+ String headerName = (String)reqHeaderEnum.nextElement();
+ responseString += CRLF + headerName + ": " +
+ req.getHeader(headerName);
+ }
+
+ responseString += CRLF;
+
+ responseLength = responseString.length();
+
+ resp.setContentType("message/http");
+ resp.setContentLength(responseLength);
+ ServletOutputStream out = resp.getOutputStream();
+ out.print(responseString);
+ out.close();
+ return;
+ }
+
+
+
/**
+ *
* Receives standard HTTP requests from the public
* <code>service</code> method and dispatches
* them to the <code>do</code><i>XXX</i> methods defined in
@@ -587,83 +657,92 @@
* {@link javax.servlet.Servlet#service} method. There's no
* need to override this method.
*
- * @param req the {@link HttpServletRequest} object that
- * contains the request the client made of
- * the servlet
*
- * @param resp the {@link HttpServletResponse} object that
- * contains the response the servlet returns
- * to the client
*
- * @exception IOException if an input or output error occurs
- * while the servlet is handling the
- * HTTP request
+ * @param req the {@link HttpServletRequest} object that
+ * contains the request the client made of
+ * the servlet
*
- * @exception ServletException if the HTTP request
- * cannot be handled
+ *
+ * @param resp the {@link HttpServletResponse} object that
+ * contains the response the servlet returns
+ * to the client
+ *
+ *
+ * @exception IOException if an input or output error occurs
+ * while the servlet is handling the
+ * HTTP request
+ *
+ * @exception ServletException if the HTTP request
+ * cannot be handled
*
- * @see javax.servlet.Servlet#service
+ * @see javax.servlet.Servlet#service
+ *
*/
+
protected void service(HttpServletRequest req, HttpServletResponse resp)
- throws ServletException, IOException {
+ throws ServletException, IOException
+ {
+ String method = req.getMethod();
- String method = req.getMethod();
-
- if (method.equals(METHOD_GET)) {
- long lastModified = getLastModified(req);
- if (lastModified == -1) {
- // servlet doesn't support if-modified-since, no reason
- // to go through further expensive logic
- doGet(req, resp);
- } else {
- long ifModifiedSince = req.getDateHeader(HEADER_IFMODSINCE);
- if (ifModifiedSince < (lastModified / 1000 * 1000)) {
- // If the servlet mod time is later, call doGet()
+ if (method.equals(METHOD_GET)) {
+ long lastModified = getLastModified(req);
+ if (lastModified == -1) {
+ // servlet doesn't support if-modified-since, no reason
+ // to go through further expensive logic
+ doGet(req, resp);
+ } else {
+ long ifModifiedSince = req.getDateHeader(HEADER_IFMODSINCE);
+ if (ifModifiedSince < (lastModified / 1000 * 1000)) {
+ // If the servlet mod time is later, call doGet()
// Round down to the nearest second for a proper compare
// A ifModifiedSince of -1 will always be less
- maybeSetLastModified(resp, lastModified);
- doGet(req, resp);
- } else {
- resp.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
- }
- }
+ maybeSetLastModified(resp, lastModified);
+ doGet(req, resp);
+ } else {
+ resp.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
+ }
+ }
- } else if (method.equals(METHOD_HEAD)) {
- long lastModified = getLastModified(req);
- maybeSetLastModified(resp, lastModified);
- doHead(req, resp);
+ } else if (method.equals(METHOD_HEAD)) {
+ long lastModified = getLastModified(req);
+ maybeSetLastModified(resp, lastModified);
+ doHead(req, resp);
- } else if (method.equals(METHOD_POST)) {
- doPost(req, resp);
-
- } else if (method.equals(METHOD_PUT)) {
- doPut(req, resp);
-
- } else if (method.equals(METHOD_DELETE)) {
- doDelete(req, resp);
-
- } else if (method.equals(METHOD_OPTIONS)) {
- doOptions(req,resp);
-
- } else if (method.equals(METHOD_TRACE)) {
- doTrace(req,resp);
-
- } else {
- //
- // Note that this means NO servlet supports whatever
- // method was requested, anywhere on this server.
- //
+ } else if (method.equals(METHOD_POST)) {
+ doPost(req, resp);
+
+ } else if (method.equals(METHOD_PUT)) {
+ doPut(req, resp);
+
+ } else if (method.equals(METHOD_DELETE)) {
+ doDelete(req, resp);
+
+ } else if (method.equals(METHOD_OPTIONS)) {
+ doOptions(req,resp);
+
+ } else if (method.equals(METHOD_TRACE)) {
+ doTrace(req,resp);
+
+ } else {
+ //
+ // Note that this means NO servlet supports whatever
+ // method was requested, anywhere on this server.
+ //
- String errMsg = lStrings.getString("http.method_not_implemented");
- Object[] errArgs = new Object[1];
- errArgs[0] = method;
- errMsg = MessageFormat.format(errMsg, errArgs);
-
- resp.sendError(HttpServletResponse.SC_NOT_IMPLEMENTED, errMsg);
- }
+ String errMsg = lStrings.getString("http.method_not_implemented");
+ Object[] errArgs = new Object[1];
+ errArgs[0] = method;
+ errMsg = MessageFormat.format(errMsg, errArgs);
+
+ resp.sendError(HttpServletResponse.SC_NOT_IMPLEMENTED, errMsg);
+ }
}
+
+
+
/*
* Sets the Last-Modified entity header field, if it has not
* already been set and if the value is meaningful. Called before
@@ -671,103 +750,120 @@
* written. A subclass might have set this header already, so we
* check.
*/
+
private void maybeSetLastModified(HttpServletResponse resp,
- long lastModified) {
- if (resp.containsHeader(HEADER_LASTMOD))
- return;
- if (lastModified >= 0)
- resp.setDateHeader(HEADER_LASTMOD, lastModified);
+ long lastModified) {
+ if (resp.containsHeader(HEADER_LASTMOD))
+ return;
+ if (lastModified >= 0)
+ resp.setDateHeader(HEADER_LASTMOD, lastModified);
}
+
+
/**
+ *
* Dispatches client requests to the protected
* <code>service</code> method. There's no need to
* override this method.
+ *
*
- * @param req the {@link HttpServletRequest} object that
- * contains the request the client made of
- * the servlet
+ * @param req the {@link HttpServletRequest} object that
+ * contains the request the client made of
+ * the servlet
*
- * @param res the {@link HttpServletResponse} object that
- * contains the response the servlet returns
- * to the client
*
- * @exception IOException if an input or output error occurs
- * while the servlet is handling the
- * HTTP request
+ * @param res the {@link HttpServletResponse} object that
+ * contains the response the servlet returns
+ * to the client
*
- * @exception ServletException if the HTTP request cannot
- * be handled
+ *
+ * @exception IOException if an input or output error occurs
+ * while the servlet is handling the
+ * HTTP request
+ *
+ * @exception ServletException if the HTTP request cannot
+ * be handled
+ *
*
* @see javax.servlet.Servlet#service
+ *
*/
+
public void service(ServletRequest req, ServletResponse res)
- throws ServletException, IOException {
-
- HttpServletRequest request;
- HttpServletResponse response;
-
- try {
- request = (HttpServletRequest) req;
- response = (HttpServletResponse) res;
- } catch (ClassCastException e) {
- throw new ServletException("non-HTTP request or response");
- }
- service(request, response);
+ throws ServletException, IOException
+ {
+ HttpServletRequest request;
+ HttpServletResponse response;
+
+ try {
+ request = (HttpServletRequest) req;
+ response = (HttpServletResponse) res;
+ } catch (ClassCastException e) {
+ throw new ServletException("non-HTTP request or response");
+ }
+ service(request, response);
}
}
+
+
/*
- * A response wrapper for use in (dumb) "HEAD" support.
+ * A response that includes no body, for use in (dumb) "HEAD" support.
* This just swallows that body, counting the bytes in order to set
- * the content length appropriately. All other methods delegate to the
- * wrapped HTTP Servlet Response object.
+ * the content length appropriately. All other methods delegate directly
+ * to the HTTP Servlet Response object used to construct this one.
*/
// file private
class NoBodyResponse extends HttpServletResponseWrapper {
- private NoBodyOutputStream noBody;
- private PrintWriter writer;
- private boolean didSetContentLength;
+ private NoBodyOutputStream noBody;
+ private PrintWriter writer;
+ private boolean didSetContentLength;
// file private
NoBodyResponse(HttpServletResponse r) {
super(r);
- noBody = new NoBodyOutputStream();
+ noBody = new NoBodyOutputStream();
}
// file private
void setContentLength() {
- if (!didSetContentLength)
- super.setContentLength(noBody.getContentLength());
+ if (!didSetContentLength)
+ super.setContentLength(noBody.getContentLength());
}
// SERVLET RESPONSE interface methods
public void setContentLength(int len) {
- super.setContentLength(len);
- didSetContentLength = true;
+ super.setContentLength(len);
+ didSetContentLength = true;
}
- public ServletOutputStream getOutputStream() throws IOException {
- return noBody;
- }
+ public ServletOutputStream getOutputStream() throws IOException
+ { return noBody; }
- public PrintWriter getWriter() throws UnsupportedEncodingException {
+ public PrintWriter getWriter() throws UnsupportedEncodingException
+ {
+ if (writer == null) {
+ OutputStreamWriter w;
- if (writer == null) {
- OutputStreamWriter w;
+ w = new OutputStreamWriter(noBody, getCharacterEncoding());
+ writer = new PrintWriter(w);
+ }
+ return writer;
+ }
- w = new OutputStreamWriter(noBody, getCharacterEncoding());
- writer = new PrintWriter(w);
- }
- return writer;
- }
}
+
+
+
+
+
/*
* Servlet output stream that gobbles up all its data.
*/
@@ -776,35 +872,35 @@
class NoBodyOutputStream extends ServletOutputStream {
private static final String LSTRING_FILE =
- "javax.servlet.http.LocalStrings";
+ "javax.servlet.http.LocalStrings";
private static ResourceBundle lStrings =
- ResourceBundle.getBundle(LSTRING_FILE);
+ ResourceBundle.getBundle(LSTRING_FILE);
- private int contentLength = 0;
+ private int contentLength = 0;
// file private
NoBodyOutputStream() {}
// file private
int getContentLength() {
- return contentLength;
+ return contentLength;
}
public void write(int b) {
- contentLength++;
+ contentLength++;
}
public void write(byte buf[], int offset, int len)
- throws IOException
+ throws IOException
{
- if (len >= 0) {
- contentLength += len;
- } else {
- // XXX
- // isn't this really an IllegalArgumentException?
-
- String msg = lStrings.getString("err.io.negativelength");
- throw new IOException(msg);
- }
+ if (len >= 0) {
+ contentLength += len;
+ } else {
+ // XXX
+ // isn't this really an IllegalArgumentException?
+
+ String msg = lStrings.getString("err.io.negativelength");
+ throw new IOException("negative length");
+ }
}
}
Modified: trunk/java/javax/servlet/http/HttpServletRequest.java
===================================================================
--- trunk/java/javax/servlet/http/HttpServletRequest.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/http/HttpServletRequest.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,21 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package javax.servlet.http;
@@ -192,7 +194,7 @@
*
*/
- public Enumeration<String> getHeaders(String name);
+ public Enumeration getHeaders(String name);
@@ -219,7 +221,7 @@
*
*/
- public Enumeration<String> getHeaderNames();
+ public Enumeration getHeaderNames();
Modified: trunk/java/javax/servlet/http/HttpServletRequestWrapper.java
===================================================================
--- trunk/java/javax/servlet/http/HttpServletRequestWrapper.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/http/HttpServletRequestWrapper.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet.http;
import javax.servlet.ServletRequestWrapper;
@@ -84,7 +87,7 @@
* The default behavior of this method is to return getHeaders(String name)
* on the wrapped request object.
*/
- public Enumeration<String> getHeaders(String name) {
+ public Enumeration getHeaders(String name) {
return this._getHttpServletRequest().getHeaders(name);
}
@@ -93,7 +96,7 @@
* on the wrapped request object.
*/
- public Enumeration<String> getHeaderNames() {
+ public Enumeration getHeaderNames() {
return this._getHttpServletRequest().getHeaderNames();
}
@@ -253,7 +256,6 @@
/**
* The default behavior of this method is to return isRequestedSessionIdFromUrl()
* on the wrapped request object.
- * @deprecated As of Version 3.0 of the Java Servlet API
*/
public boolean isRequestedSessionIdFromUrl() {
return this._getHttpServletRequest().isRequestedSessionIdFromUrl();
Modified: trunk/java/javax/servlet/http/HttpServletResponse.java
===================================================================
--- trunk/java/javax/servlet/http/HttpServletResponse.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/http/HttpServletResponse.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet.http;
import java.io.IOException;
Modified: trunk/java/javax/servlet/http/HttpServletResponseWrapper.java
===================================================================
--- trunk/java/javax/servlet/http/HttpServletResponseWrapper.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/http/HttpServletResponseWrapper.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet.http;
import java.io.IOException;
@@ -87,7 +90,6 @@
/**
* The default behavior of this method is to call encodeUrl(String url)
* on the wrapped response object.
- * @deprecated As of Version 3.0 of the Java Servlet API
*/
public String encodeUrl(String url) {
return this._getHttpServletResponse().encodeUrl(url);
@@ -96,7 +98,6 @@
/**
* The default behavior of this method is to return encodeRedirectUrl(String url)
* on the wrapped response object.
- * @deprecated As of Version 3.0 of the Java Servlet API
*/
public String encodeRedirectUrl(String url) {
return this._getHttpServletResponse().encodeRedirectUrl(url);
@@ -189,7 +190,6 @@
/**
* The default behavior of this method is to call setStatus(int sc, String sm)
* on the wrapped response object.
- * @deprecated As of Version 3.0 of the Java Servlet API
*/
public void setStatus(int sc, String sm) {
this._getHttpServletResponse().setStatus(sc, sm);
Modified: trunk/java/javax/servlet/http/HttpSession.java
===================================================================
--- trunk/java/javax/servlet/http/HttpSession.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/http/HttpSession.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet.http;
import java.util.Enumeration;
@@ -257,7 +260,7 @@
*
*/
- public Enumeration<String> getAttributeNames();
+ public Enumeration getAttributeNames();
Modified: trunk/java/javax/servlet/http/HttpSessionActivationListener.java
===================================================================
--- trunk/java/javax/servlet/http/HttpSessionActivationListener.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/http/HttpSessionActivationListener.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet.http;
import java.util.EventListener;
Modified: trunk/java/javax/servlet/http/HttpSessionAttributeListener.java
===================================================================
--- trunk/java/javax/servlet/http/HttpSessionAttributeListener.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/http/HttpSessionAttributeListener.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet.http;
import java.util.EventListener;
Modified: trunk/java/javax/servlet/http/HttpSessionBindingEvent.java
===================================================================
--- trunk/java/javax/servlet/http/HttpSessionBindingEvent.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/http/HttpSessionBindingEvent.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,26 +1,25 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package javax.servlet.http;
-
-
/**
- *
* Events of this type are either sent to an object that implements
* {@link HttpSessionBindingListener} when it is bound or
* unbound from a session, or to a {@link HttpSessionAttributeListener}
@@ -40,12 +39,7 @@
* @see HttpSessionBindingListener
* @see HttpSessionAttributeListener
*/
-
public class HttpSessionBindingEvent extends HttpSessionEvent {
-
-
-
-
/* The name to which the object is being bound or unbound */
private String name;
Modified: trunk/java/javax/servlet/http/HttpSessionBindingListener.java
===================================================================
--- trunk/java/javax/servlet/http/HttpSessionBindingListener.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/http/HttpSessionBindingListener.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,28 +1,26 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package javax.servlet.http;
import java.util.EventListener;
-
-
-
-
/**
* Causes an object to be notified when it is bound to
* or unbound from a session. The object is notified
@@ -36,13 +34,8 @@
*
* @see HttpSession
* @see HttpSessionBindingEvent
- *
*/
-
public interface HttpSessionBindingListener extends EventListener {
-
-
-
/**
*
* Notifies the object that it is being bound to
Modified: trunk/java/javax/servlet/http/HttpSessionContext.java
===================================================================
--- trunk/java/javax/servlet/http/HttpSessionContext.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/http/HttpSessionContext.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,27 +1,27 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
-
package javax.servlet.http;
import java.util.Enumeration;
/**
- *
* @author Various
* @version $Version$
*
@@ -35,8 +35,6 @@
* @see HttpSessionBindingListener
*
*/
-
-
public interface HttpSessionContext {
/**
@@ -62,7 +60,7 @@
*
*/
- public Enumeration<String> getIds();
+ public Enumeration getIds();
}
Modified: trunk/java/javax/servlet/http/HttpSessionEvent.java
===================================================================
--- trunk/java/javax/servlet/http/HttpSessionEvent.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/http/HttpSessionEvent.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,22 +1,24 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet.http;
-
/** This is the class representing event notifications for
* changes to sessions within a web application.
* @since v 2.3
Modified: trunk/java/javax/servlet/http/HttpSessionListener.java
===================================================================
--- trunk/java/javax/servlet/http/HttpSessionListener.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/http/HttpSessionListener.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,22 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
package javax.servlet.http;
import java.util.EventListener;
Modified: trunk/java/javax/servlet/http/HttpUtils.java
===================================================================
--- trunk/java/javax/servlet/http/HttpUtils.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/http/HttpUtils.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,19 +1,21 @@
/*
-* Licensed to the Apache Software Foundation (ASF) under one or more
-* contributor license agreements. See the NOTICE file distributed with
-* this work for additional information regarding copyright ownership.
-* The ASF licenses this file to You under the Apache License, Version 2.0
-* (the "License"); you may not use this file except in compliance with
-* the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
package javax.servlet.http;
@@ -84,18 +86,18 @@
*
*/
- static public Hashtable<String,String[]> parseQueryString(String s) {
+ static public Hashtable parseQueryString(String s) {
String valArray[] = null;
if (s == null) {
throw new IllegalArgumentException();
}
- Hashtable<String,String[]> ht = new Hashtable<String,String[]>();
+ Hashtable ht = new Hashtable();
StringBuffer sb = new StringBuffer();
StringTokenizer st = new StringTokenizer(s, "&");
while (st.hasMoreTokens()) {
- String pair = st.nextToken();
+ String pair = (String)st.nextToken();
int pos = pair.indexOf('=');
if (pos == -1) {
// XXX
@@ -105,7 +107,7 @@
String key = parseName(pair.substring(0, pos), sb);
String val = parseName(pair.substring(pos+1, pair.length()), sb);
if (ht.containsKey(key)) {
- String oldVals[] = ht.get(key);
+ String oldVals[] = (String []) ht.get(key);
valArray = new String[oldVals.length + 1];
for (int i = 0; i < oldVals.length; i++)
valArray[i] = oldVals[i];
@@ -163,17 +165,15 @@
*/
- static public Hashtable<String,String[]> parsePostData(int len,
+ static public Hashtable parsePostData(int len,
ServletInputStream in)
{
// XXX
// should a length of 0 be an IllegalArgumentException
- // cheap hack to return an empty hash
- if (len <=0)
- return new Hashtable<String,String[]>();
+ if (len <=0)
+ return new Hashtable(); // cheap hack to return an empty hash
-
if (in == null) {
throw new IllegalArgumentException();
}
Deleted: trunk/java/javax/servlet/http/LocalStrings.properties
===================================================================
--- trunk/java/javax/servlet/http/LocalStrings.properties 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/http/LocalStrings.properties 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,28 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Default localized string information
-# Localized for Locale en_US
-
-err.cookie_name_is_token=Cookie name \"{0}\" is a reserved token
-err.io.negativelength=Negative Length given in write method
-err.io.short_read=Short Read
-
-http.method_not_implemented=Method {0} is not defined in RFC 2068 and is not supported by the Servlet API
-
-http.method_get_not_supported=HTTP method GET is not supported by this URL
-http.method_post_not_supported=HTTP method POST is not supported by this URL
-http.method_put_not_supported=HTTP method PUT is not supported by this URL
-http.method_delete_not_supported=Http method DELETE is not supported by this URL
Deleted: trunk/java/javax/servlet/http/LocalStrings_es.properties
===================================================================
--- trunk/java/javax/servlet/http/LocalStrings_es.properties 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/http/LocalStrings_es.properties 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,30 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# $Id$
-#
-# Default localized string information
-# Localized para Locale es_ES
-
-err.cookie_name_is_token=El Nombre de Cookie {0} es una palabra reservada
-err.io.negativelength=Longitud Negativa en el metodo write
-err.io.short_read=Lectura Corta
-
-http.method_not_implemented=El Metodo {0} no esta definido en la especificacion RFC 2068 y no es soportado por la API Servlet
-
-http.method_get_not_supported=El Metodo HTTP GET no es soportado por esta URL
-http.method_post_not_supported=El Metodo HTTP POST no es soportado por esta URL
-http.method_put_not_supported=El Metodo HTTP PUT no es soportado por esta URL
-http.method_delete_not_supported=El Metodo HTTP DELETE no es soportado por esta URL
Deleted: trunk/java/javax/servlet/http/LocalStrings_fr.properties
===================================================================
--- trunk/java/javax/servlet/http/LocalStrings_fr.properties 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/http/LocalStrings_fr.properties 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,28 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Default localized string information
-# Localized for Locale fr_FR
-
-err.cookie_name_is_token=Le nom de cookie \"{0}\" est un \"token\" r�serv�
-err.io.negativelength=Taille n�gative donn�e dans la m�thode \"write\"
-err.io.short_read=Lecture partielle
-
-http.method_not_implemented=Le m�thode {0} n''est pas d�finie dans la RFC 2068 et n''est pas support�e par l''API Servlet
-
-http.method_get_not_supported=La m�thode HTTP GET n''est pas support�e par cette URL
-http.method_post_not_supported=La m�thode HTTP POST n''est pas support�e par cette URL
-http.method_put_not_supported=La m�thode HTTP PUT n''est pas support�e par cette URL
-http.method_delete_not_supported=La m�thode HTTP DELETE n''est pas support�e par cette URL
Deleted: trunk/java/javax/servlet/http/LocalStrings_ja.properties
===================================================================
--- trunk/java/javax/servlet/http/LocalStrings_ja.properties 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/http/LocalStrings_ja.properties 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,28 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Default localized string information
-# Localized for Locale ja_JP
-
-err.cookie_name_is_token=\u30af\u30c3\u30ad\u30fc\u540d \"{0}\" \u306f\u4e88\u7d04\u6e08\u306e\u30c8\u30fc\u30af\u30f3\u3067\u3059\u3002
-err.io.negativelength=write\u30e1\u30bd\u30c3\u30c9\u306b\u8ca0\u306e\u9577\u3055\u304c\u6307\u5b9a\u3055\u308c\u307e\u3057\u305f\u3002
-err.io.short_read=\u8aad\u307f\u8fbc\u307f\u304c\u3059\u3050\u306b\u7d42\u308f\u308a\u307e\u3057\u305f\u3002
-
-http.method_not_implemented=\u30e1\u30bd\u30c3\u30c9 {0} \u306fRFC 2068\u306b\u306f\u5b9a\u7fa9\u3055\u308c\u3066\u304a\u3089\u305a\u3001\u30b5\u30fc\u30d6\u30ec\u30c3\u30c8API\u3067\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u307e\u305b\u3093\u3002
-
-http.method_get_not_supported=HTTP\u306eGET\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u3053\u306eURL\u3067\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002
-http.method_post_not_supported=HTTP\u306ePOST\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u3053\u306eURL\u3067\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002
-http.method_put_not_supported=HTTP\u306ePUT\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u3053\u306eURL\u3067\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002
-http.method_delete_not_supported=HTTP\u306eDELETE\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u3053\u306eURL\u3067\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002
Added: trunk/java/javax/servlet/http/annotation/FilterMapping.java
===================================================================
--- trunk/java/javax/servlet/http/annotation/FilterMapping.java (rev 0)
+++ trunk/java/javax/servlet/http/annotation/FilterMapping.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package javax.servlet.http.annotation;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+import javax.servlet.DispatcherType;
+
+/**
+ * @version $Rev: 675701 $ $Date: 2008-07-10 21:49:52 +0200 (Thu, 10 Jul 2008) $
+ * @since 3.0
+ */
+
+(a)Target(value=ElementType.TYPE)
+@Retention(value= RetentionPolicy.RUNTIME)
+public @interface FilterMapping {
+
+ String[] urlPattern();
+
+ String[] servletNames() default {};
+
+ DispatcherType[] dispatcherTypes() default {DispatcherType.REQUEST};
+
+}
Added: trunk/java/javax/servlet/http/annotation/InitParam.java
===================================================================
--- trunk/java/javax/servlet/http/annotation/InitParam.java (rev 0)
+++ trunk/java/javax/servlet/http/annotation/InitParam.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package javax.servlet.http.annotation;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * @version $Rev: 675701 $ $Date: 2008-07-10 21:49:52 +0200 (Thu, 10 Jul 2008) $
+ */
+
+@Target(value= ElementType.TYPE)
+@Retention(value= RetentionPolicy.RUNTIME)
+public @interface InitParam {
+
+ String description() default "";
+
+ String name() default "";
+
+ String value() default "";
+
+}
Added: trunk/java/javax/servlet/http/annotation/Servlet.java
===================================================================
--- trunk/java/javax/servlet/http/annotation/Servlet.java (rev 0)
+++ trunk/java/javax/servlet/http/annotation/Servlet.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package javax.servlet.http.annotation;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * @version $Rev: 675701 $ $Date: 2008-07-10 21:49:52 +0200 (Thu, 10 Jul 2008) $
+ * @since 3.0
+ */
+
+@Target(value= ElementType.TYPE)
+@Retention(value= RetentionPolicy.RUNTIME)
+public @interface Servlet {
+ String[] urlMappings();
+
+ String icon() default "";
+
+ InitParam[] initParams() default {};
+
+ int loadOnStartup() default -1;
+
+ String name() default "";
+
+}
Added: trunk/java/javax/servlet/http/annotation/ServletContextListener.java
===================================================================
--- trunk/java/javax/servlet/http/annotation/ServletContextListener.java (rev 0)
+++ trunk/java/javax/servlet/http/annotation/ServletContextListener.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package javax.servlet.http.annotation;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * @version $Rev: 675701 $ $Date: 2008-07-10 21:49:52 +0200 (Thu, 10 Jul 2008) $
+ * @since 3.0
+ */
+
+@Target(value= ElementType.TYPE)
+@Retention(value= RetentionPolicy.RUNTIME)
+public @interface ServletContextListener {
+
+ String description() default "";
+}
Added: trunk/java/javax/servlet/http/annotation/ServletFilter.java
===================================================================
--- trunk/java/javax/servlet/http/annotation/ServletFilter.java (rev 0)
+++ trunk/java/javax/servlet/http/annotation/ServletFilter.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package javax.servlet.http.annotation;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+/**
+ * @version $Rev: 675701 $ $Date: 2008-07-10 21:49:52 +0200 (Thu, 10 Jul 2008) $
+ * @since 3.0
+ */
+
+@Target(value= ElementType.TYPE)
+@Retention(value= RetentionPolicy.RUNTIME)
+public @interface ServletFilter {
+
+ String description() default "";
+
+ String displayName() default "";
+
+ String filterName() default "";
+
+ String icon() default "";
+
+ InitParam[] initParams() default {};
+}
Deleted: trunk/java/javax/servlet/http/package.html
===================================================================
--- trunk/java/javax/servlet/http/package.html 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/http/package.html 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,30 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<HTML>
-<HEAD>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-</HEAD>
-<BODY BGCOLOR="white">
-
-The javax.servlet.http package contains a number of classes and interfaces
-that describe and define the contracts between a servlet class
-running under the HTTP protocol and the runtime environment provided
-for an instance of such a class by a conforming servlet container.
-
-
-</BODY>
-</HTML>
Deleted: trunk/java/javax/servlet/package.html
===================================================================
--- trunk/java/javax/servlet/package.html 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/javax/servlet/package.html 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,30 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<HTML>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<HEAD>
-</HEAD>
-<BODY BGCOLOR="white">
-
-The javax.servlet package contains a number of classes and interfaces that
-describe and define the contracts between a servlet class and the
-runtime environment provided for an instance of such a class by a
-conforming servlet container.
-
-
-</BODY>
-</HTML>
Deleted: trunk/java/org/apache/catalina/ClassLoadingAnnotationScanner.java
===================================================================
--- trunk/java/org/apache/catalina/ClassLoadingAnnotationScanner.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/org/apache/catalina/ClassLoadingAnnotationScanner.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.catalina;
-
-import java.util.List;
-
-public interface ClassLoadingAnnotationScanner {
-
- /**
- * Scan the given context's default locations for annotations.
- *
- * @param context
- */
- public List<Class<?>> scan(Context context);
-
-
-}
Modified: trunk/java/org/apache/catalina/connector/Request.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Request.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/org/apache/catalina/connector/Request.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -37,6 +37,7 @@
import javax.security.auth.Subject;
import javax.servlet.AsyncContext;
import javax.servlet.AsyncListener;
+import javax.servlet.DispatcherType;
import javax.servlet.FilterChain;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
@@ -2780,5 +2781,17 @@
// TODO Auto-generated method stub
return null;
}
+
+ @Override
+ public DispatcherType getDispatcherType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ServletResponse getServletResponse() {
+ // TODO Auto-generated method stub
+ return null;
+ }
}
Modified: trunk/java/org/apache/catalina/connector/RequestFacade.java
===================================================================
--- trunk/java/org/apache/catalina/connector/RequestFacade.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/org/apache/catalina/connector/RequestFacade.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -28,6 +28,7 @@
import javax.servlet.AsyncContext;
import javax.servlet.AsyncListener;
+import javax.servlet.DispatcherType;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletInputStream;
@@ -1029,4 +1030,24 @@
return request.startAsync(servletRequest, servletResponse);
}
+
+ public DispatcherType getDispatcherType() {
+ if (request == null) {
+ throw new IllegalStateException(
+ sm.getString("requestFacade.nullRequest"));
+ }
+
+ return request.getDispatcherType();
+ }
+
+
+ public ServletResponse getServletResponse() {
+ if (request == null) {
+ throw new IllegalStateException(
+ sm.getString("requestFacade.nullRequest"));
+ }
+
+ return request.getServletResponse();
+ }
+
}
Modified: trunk/java/org/apache/catalina/connector/Response.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Response.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/org/apache/catalina/connector/Response.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -866,6 +866,22 @@
}
+ public void disable() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void enable() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public boolean isDisabled() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+
// --------------------------------------------------- HttpResponse Methods
@@ -1624,6 +1640,5 @@
}
-
}
Modified: trunk/java/org/apache/catalina/connector/ResponseFacade.java
===================================================================
--- trunk/java/org/apache/catalina/connector/ResponseFacade.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/org/apache/catalina/connector/ResponseFacade.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -552,4 +552,34 @@
response.setCharacterEncoding(arg0);
}
+
+ public void disable() {
+ if (response == null) {
+ throw new IllegalStateException(
+ sm.getString("responseFacade.nullResponse"));
+ }
+
+ response.disable();
+ }
+
+
+ public void enable() {
+ if (response == null) {
+ throw new IllegalStateException(
+ sm.getString("responseFacade.nullResponse"));
+ }
+
+ response.enable();
+ }
+
+
+ public boolean isDisabled() {
+ if (response == null) {
+ throw new IllegalStateException(
+ sm.getString("responseFacade.nullResponse"));
+ }
+
+ return response.isDisabled();
+ }
+
}
Modified: trunk/java/org/apache/catalina/core/ApplicationContext.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationContext.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/org/apache/catalina/core/ApplicationContext.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -35,11 +35,13 @@
import javax.naming.NamingException;
import javax.naming.directory.DirContext;
import javax.servlet.DispatcherType;
+import javax.servlet.FilterRegistration;
import javax.servlet.RequestDispatcher;
import javax.servlet.Servlet;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextAttributeEvent;
import javax.servlet.ServletContextAttributeListener;
+import javax.servlet.ServletRegistration;
import javax.servlet.SessionCookieConfig;
import javax.servlet.SessionTrackingMode;
@@ -814,6 +816,7 @@
}
+ // FIXME: removed
public void addFilter(String filterName, String description,
String className, Map<String, String> initParameters,
boolean isAsyncSupported) {
@@ -834,6 +837,7 @@
}
+ // FIXME: removed
public void addFilterMappingForServletNames(String filterName,
EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter,
String... servletNames) {
@@ -858,6 +862,7 @@
}
+ // FIXME: removed
public void addFilterMappingForUrlPatterns(String filterName,
EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter,
String... urlPatterns) {
@@ -883,6 +888,7 @@
}
+ // FIXME: removed
public void addServletMapping(String servletName, String[] urlPatterns) {
if (context.initialized) {
//TODO Spec breaking enhancement to ignore this restriction
@@ -896,6 +902,32 @@
}
+ public FilterRegistration addFilter(String filterName, String className)
+ throws IllegalArgumentException, IllegalStateException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public ServletRegistration addServlet(String servletName, String className)
+ throws IllegalArgumentException, IllegalStateException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public FilterRegistration findFilterRegistration(String filterName) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
+ public ServletRegistration findServletRegistration(String servletName) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+
/**
* By default {@link SessionTrackingMode#URL} is always supported, {@link
* SessionTrackingMode#COOKIE} is supported unless the <code>cookies</code>
Modified: trunk/java/org/apache/catalina/core/ApplicationContextFacade.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationContextFacade.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/org/apache/catalina/core/ApplicationContextFacade.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -34,10 +34,12 @@
import java.util.Set;
import javax.servlet.DispatcherType;
+import javax.servlet.FilterRegistration;
import javax.servlet.RequestDispatcher;
import javax.servlet.Servlet;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
+import javax.servlet.ServletRegistration;
import javax.servlet.SessionCookieConfig;
import javax.servlet.SessionTrackingMode;
@@ -369,54 +371,44 @@
}
- public void addFilter(String filterName, String description,
- String className, Map<String, String> initParameters,
- boolean isAsyncSupported) {
+ public FilterRegistration addFilter(String filterName, String className)
+ throws IllegalArgumentException, IllegalStateException {
if (SecurityUtil.isPackageProtectionEnabled()) {
- doPrivileged("addFilter", new Object[]{filterName, description,
- className, initParameters,
- Boolean.valueOf(isAsyncSupported)});
+ return (FilterRegistration) doPrivileged("addFilter",
+ new Object[]{filterName, className});
} else {
- context.addFilter(filterName, description, className,
- initParameters, isAsyncSupported);
+ return context.addFilter(filterName, className);
}
}
- public void addFilterMappingForServletNames(String filterName,
- EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter,
- String... servletNames) {
+ public ServletRegistration addServlet(String servletName, String className)
+ throws IllegalArgumentException, IllegalStateException {
if (SecurityUtil.isPackageProtectionEnabled()) {
- doPrivileged("addFilterMappingForServletNames",
- new Object[]{filterName, dispatcherTypes,
- Boolean.valueOf(isMatchAfter), servletNames});
+ return (ServletRegistration) doPrivileged("addServlet",
+ new Object[]{servletName, className});
} else {
- context.addFilterMappingForServletNames(filterName, dispatcherTypes,
- isMatchAfter, servletNames);
+ return context.addServlet(servletName, className);
}
}
- public void addFilterMappingForUrlPatterns(String filterName,
- EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter,
- String... urlPatterns) {
+ public FilterRegistration findFilterRegistration(String filterName) {
if (SecurityUtil.isPackageProtectionEnabled()) {
- doPrivileged("addFilterMappingForUrlPatterns",
- new Object[]{filterName, dispatcherTypes,
- Boolean.valueOf(isMatchAfter), urlPatterns});
+ return (FilterRegistration) doPrivileged("findFilterRegistration",
+ new Object[]{filterName});
} else {
- context.addFilterMappingForUrlPatterns(filterName, dispatcherTypes,
- isMatchAfter, urlPatterns);
+ return context.findFilterRegistration(filterName);
}
}
- public void addServletMapping(String servletName, String[] urlPatterns) {
+ public ServletRegistration findServletRegistration(String servletName) {
if (SecurityUtil.isPackageProtectionEnabled()) {
- doPrivileged("addServletMapping",
- new Object[]{servletName, urlPatterns});
+ return (ServletRegistration) doPrivileged("findServletRegistration",
+ new Object[]{servletName});
} else {
- context.addServletMapping(servletName, urlPatterns);
+ return context.findServletRegistration(servletName);
}
}
Modified: trunk/java/org/apache/catalina/core/ClassLoadingAnnotationScanner.java
===================================================================
--- trunk/java/org/apache/catalina/core/ClassLoadingAnnotationScanner.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/org/apache/catalina/core/ClassLoadingAnnotationScanner.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -21,10 +21,11 @@
import java.io.File;
import java.util.jar.JarEntry;
-import javax.servlet.annotation.InitParam;
-import javax.servlet.annotation.ServletFilter;
-import javax.servlet.annotation.WebServlet;
-import javax.servlet.annotation.WebServletContextListener;
+import javax.servlet.http.annotation.FilterMapping;
+import javax.servlet.http.annotation.InitParam;
+import javax.servlet.http.annotation.Servlet;
+import javax.servlet.http.annotation.ServletContextListener;
+import javax.servlet.http.annotation.ServletFilter;
import org.apache.catalina.Context;
@@ -40,8 +41,9 @@
Class<?> clazz = context.getLoader().getClassLoader().loadClass(className);
if (clazz.isAnnotationPresent(InitParam.class)
|| clazz.isAnnotationPresent(ServletFilter.class)
- || clazz.isAnnotationPresent(WebServlet.class)
- || clazz.isAnnotationPresent(WebServletContextListener.class)) {
+ || clazz.isAnnotationPresent(FilterMapping.class)
+ || clazz.isAnnotationPresent(Servlet.class)
+ || clazz.isAnnotationPresent(ServletContextListener.class)) {
return clazz;
}
} catch (Throwable t) {
Modified: trunk/java/org/apache/catalina/core/DummyRequest.java
===================================================================
--- trunk/java/org/apache/catalina/core/DummyRequest.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/org/apache/catalina/core/DummyRequest.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -32,6 +32,7 @@
import javax.servlet.AsyncContext;
import javax.servlet.AsyncListener;
+import javax.servlet.DispatcherType;
import javax.servlet.FilterChain;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
@@ -279,6 +280,8 @@
public AsyncContext startAsync() throws IllegalStateException { return null; }
public AsyncContext startAsync(ServletRequest servletRequest,
ServletResponse servletResponse) throws IllegalStateException { return null; }
+ public DispatcherType getDispatcherType() { return null; }
+ public ServletResponse getServletResponse() { return null; }
}
Modified: trunk/java/org/apache/catalina/core/DummyResponse.java
===================================================================
--- trunk/java/org/apache/catalina/core/DummyResponse.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/org/apache/catalina/core/DummyResponse.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -120,6 +120,9 @@
public void setIntHeader(String name, int value) {}
public void setStatus(int status) {}
public void setStatus(int status, String message) {}
+ public void disable() {}
+ public void enable() {}
+ public boolean isDisabled() { return false; }
}
Modified: trunk/java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/org/apache/catalina/startup/ContextConfig.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -25,10 +25,16 @@
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
+import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
import javax.servlet.ServletContext;
+import javax.servlet.http.annotation.FilterMapping;
+import javax.servlet.http.annotation.InitParam;
+import javax.servlet.http.annotation.Servlet;
+import javax.servlet.http.annotation.ServletContextListener;
+import javax.servlet.http.annotation.ServletFilter;
import org.apache.catalina.Authenticator;
import org.apache.catalina.Container;
@@ -42,6 +48,7 @@
import org.apache.catalina.Pipeline;
import org.apache.catalina.Valve;
import org.apache.catalina.Wrapper;
+import org.apache.catalina.core.ClassLoadingAnnotationScanner;
import org.apache.catalina.core.ContainerBase;
import org.apache.catalina.core.StandardContext;
import org.apache.catalina.core.StandardEngine;
@@ -294,6 +301,36 @@
long t1=System.currentTimeMillis();
+ Iterator<Class<?>> annotatedClasses = (new ClassLoadingAnnotationScanner()).scan(context).iterator();
+ while (annotatedClasses.hasNext()) {
+ Class<?> clazz = annotatedClasses.next();
+ if (clazz.isAnnotationPresent(InitParam.class)) {
+ InitParam annotation = clazz.getAnnotation(InitParam.class);
+ // Add init param
+ // FIXME
+ }
+ if (clazz.isAnnotationPresent(ServletFilter.class)) {
+ ServletFilter annotation = clazz.getAnnotation(ServletFilter.class);
+ // Add servlet filter
+ // FIXME
+ }
+ if (clazz.isAnnotationPresent(FilterMapping.class)) {
+ FilterMapping annotation = clazz.getAnnotation(FilterMapping.class);
+ // Add filter mapping
+ // FIXME
+ }
+ if (clazz.isAnnotationPresent(Servlet.class)) {
+ Servlet annotation = clazz.getAnnotation(Servlet.class);
+ // Add servlet
+ // FIXME
+ }
+ if (clazz.isAnnotationPresent(ServletContextListener.class)) {
+ ServletContextListener annotation = clazz.getAnnotation(ServletContextListener.class);
+ // Add listener
+ // FIXME
+ }
+ }
+
WebAnnotationSet.loadApplicationAnnotations(context);
long t2=System.currentTimeMillis();
Modified: trunk/java/org/apache/jasper/servlet/JspCServletContext.java
===================================================================
--- trunk/java/org/apache/jasper/servlet/JspCServletContext.java 2009-02-13 15:21:15 UTC (rev 930)
+++ trunk/java/org/apache/jasper/servlet/JspCServletContext.java 2009-02-13 17:27:21 UTC (rev 931)
@@ -27,15 +27,15 @@
import java.util.Enumeration;
import java.util.HashSet;
import java.util.Hashtable;
-import java.util.Map;
import java.util.Set;
import java.util.Vector;
-import javax.servlet.DispatcherType;
+import javax.servlet.FilterRegistration;
import javax.servlet.RequestDispatcher;
import javax.servlet.Servlet;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
+import javax.servlet.ServletRegistration;
import javax.servlet.SessionCookieConfig;
import javax.servlet.SessionTrackingMode;
@@ -442,29 +442,25 @@
}
- public void addFilter(String filterName, String description,
- String className, Map<String, String> initParameters,
- boolean isAsyncSupported) {
- // Do nothing
+ public FilterRegistration addFilter(String filterName, String className)
+ throws IllegalArgumentException, IllegalStateException {
+ return null;
}
- public void addFilterMappingForServletNames(String filterName,
- EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter,
- String... servletNames) {
- // Do nothing
+ public ServletRegistration addServlet(String servletName, String className)
+ throws IllegalArgumentException, IllegalStateException {
+ return null;
}
- public void addFilterMappingForUrlPatterns(String filterName,
- EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter,
- String... urlPatterns) {
- // Do nothing
+ public FilterRegistration findFilterRegistration(String filterName) {
+ return null;
}
- public void addServletMapping(String servletName, String[] urlPatterns) {
- // Do nothing
+ public ServletRegistration findServletRegistration(String servletName) {
+ return null;
}
15 years, 10 months
JBossWeb SVN: r930 - in trunk: java/org/apache/catalina/core and 1 other directories.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-02-13 10:21:15 -0500 (Fri, 13 Feb 2009)
New Revision: 930
Added:
trunk/java/org/apache/catalina/AnnotationScanner.java
trunk/java/org/apache/catalina/ClassLoadingAnnotationScanner.java
trunk/java/org/apache/catalina/core/BaseAnnotationScanner.java
trunk/java/org/apache/catalina/core/ClassLoadingAnnotationScanner.java
trunk/java/org/apache/catalina/core/JavassistAnnotationScanner.java
Removed:
trunk/java/org/apache/catalina/core/AnnotationScanner.java
Modified:
trunk/webapps/docs/changelog.xml
Log:
- Repackage using a class hierarchy (I am told JBoss developers get fired if their class hierarchy is not at least 10 deep,
so not there yet).
Added: trunk/java/org/apache/catalina/AnnotationScanner.java
===================================================================
--- trunk/java/org/apache/catalina/AnnotationScanner.java (rev 0)
+++ trunk/java/org/apache/catalina/AnnotationScanner.java 2009-02-13 15:21:15 UTC (rev 930)
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.catalina;
+
+import java.util.List;
+
+public interface AnnotationScanner {
+
+ /**
+ * Scan the given context's default locations for annotations.
+ *
+ * @param context
+ */
+ public List<Class<?>> scan(Context context);
+
+
+}
Added: trunk/java/org/apache/catalina/ClassLoadingAnnotationScanner.java
===================================================================
--- trunk/java/org/apache/catalina/ClassLoadingAnnotationScanner.java (rev 0)
+++ trunk/java/org/apache/catalina/ClassLoadingAnnotationScanner.java 2009-02-13 15:21:15 UTC (rev 930)
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.catalina;
+
+import java.util.List;
+
+public interface ClassLoadingAnnotationScanner {
+
+ /**
+ * Scan the given context's default locations for annotations.
+ *
+ * @param context
+ */
+ public List<Class<?>> scan(Context context);
+
+
+}
Deleted: trunk/java/org/apache/catalina/core/AnnotationScanner.java
===================================================================
--- trunk/java/org/apache/catalina/core/AnnotationScanner.java 2009-02-13 15:19:22 UTC (rev 929)
+++ trunk/java/org/apache/catalina/core/AnnotationScanner.java 2009-02-13 15:21:15 UTC (rev 930)
@@ -1,250 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-package org.apache.catalina.core;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-
-import javax.naming.directory.DirContext;
-import javax.servlet.annotation.InitParam;
-import javax.servlet.annotation.ServletFilter;
-import javax.servlet.annotation.WebServlet;
-import javax.servlet.annotation.WebServletContextListener;
-
-import org.apache.catalina.Context;
-
-public class AnnotationScanner {
-
- public static final boolean USE_JAVASSIST =
- Boolean.valueOf(System.getProperty("org.apache.catalina.core.AnnotationScanner.USE_JAVASSIST", "false")).booleanValue();
-
- /**
- * Scan the given context's default locations for annotations.
- *
- * @param context
- */
- public List<Class<?>> scan(Context context) {
- ArrayList<Class<?>> result = new ArrayList<Class<?>>();
-
- if (context.getLoader().findLoaderRepositories() != null) {
- String[] repositories = context.getLoader().findLoaderRepositories();
- for (int i = 0; i < repositories.length; i++) {
- if (repositories[i].endsWith(".jar")) {
- try {
- scanJar(result, context, new JarFile(repositories[i]));
- } catch (IOException e) {
- // Ignore
- }
- } else {
- scanClasses(result, context, new File(repositories[i]), "");
- }
- }
- }
-
- return result;
- /*
- DirContext resources = context.getResources();
- DirContext webInfClasses = null;
- DirContext webInfLib = null;
-
- try {
- webInfClasses = (DirContext) resources.lookup("/WEB-INF/classes");
- } catch (Exception e) {
- // Ignore, /WEB-INF/classes not found, or not a folder
- }
- if (webInfClasses != null) {
- scanClasses(context, webInfClasses, "");
- }
-
- try {
- webInfLib = (DirContext) resources.lookup("/WEB-INF/lib");
- } catch (Exception e) {
- // Ignore, /WEB-INF/classes not found, or not a folder
- }
- if (webInfLib != null) {
- scanJars(context, webInfLib);
- }*/
-
- }
-
-
- /**
- * Scan folder containing class files.
- */
- public void scanClasses(List<Class<?>> result, Context context, File folder, String path) {
- String[] files = folder.list();
- for (int i = 0; i < files.length; i++) {
- File file = new File(folder, files[i]);
- if (file.isDirectory()) {
- scanClasses(result, context, file, path + "/" + files[i]);
- } else if (files[i].endsWith(".class")) {
- String className = getClassName(path + "/" + files[i]);
- Class<?> annotated = scanClass(context, className, file, null);
- if (annotated != null) {
- result.add(annotated);
- }
- }
- }
- }
-
-
- /**
- * Scan folder containing class files.
- */
- /*
- public static void scanClasses(Context context, DirContext folder, String path) {
- try {
- NamingEnumeration<Binding> enumeration = folder.listBindings(path);
- while (enumeration.hasMore()) {
- Binding binding = enumeration.next();
- Object object = binding.getObject();
-
- if (object instanceof Resource) {
- // This is a class, so we should load it
- String className = getClassName(path + "/" + binding.getName());
- scanClass(context, className, (Resource) object, null, null);
- } else if (object instanceof DirContext) {
- scanClasses(context, folder, path + "/" + binding.getName());
- }
-
- }
- } catch (NamingException e) {
- // Ignore for now
- e.printStackTrace();
- }
- }*/
-
-
- /**
- * Scan folder containing JAR files.
- */
- public void scanJars(List<Class<?>> result, Context context, DirContext folder) {
- if (context.getLoader().findLoaderRepositories() != null) {
- String[] repositories = context.getLoader().findLoaderRepositories();
- for (int i = 0; i < repositories.length; i++) {
- if (repositories[i].endsWith(".jar")) {
- try {
- scanJar(result, context, new JarFile(repositories[i]));
- } catch (IOException e) {
- // Ignore
- }
- }
- }
- }
- /*else {
- try {
- NamingEnumeration<Binding> enumeration = folder.listBindings("");
- while (enumeration.hasMore()) {
- Binding binding = enumeration.next();
- Object object = binding.getObject();
-
- if (object instanceof Resource && binding.getName().endsWith(".jar")) {
- // This is normally a JAR, put it in the work folder
- File destDir = null;
- File workDir =
- (File) context.getServletContext().getAttribute(Globals.WORK_DIR_ATTR);
- destDir = new File(workDir, "WEB-INF/lib");
- destDir.mkdirs();
- File destFile = new File(destDir, binding.getName());
-
- scanJar(context, (Resource) object);
- }
-
- }
- } catch (NamingException e) {
- // Ignore for now
- e.printStackTrace();
- }
- }*/
- }
-
-
- /**
- * Scan all class files in the given JAR.
- */
- public void scanJar(List<Class<?>> result, Context context, JarFile file) {
- Enumeration<JarEntry> entries = file.entries();
- while (entries.hasMoreElements()) {
- JarEntry entry = entries.nextElement();
- if (entry.getName().endsWith(".class")) {
- Class<?> annotated = scanClass(context, getClassName(entry.getName()), null, entry);
- if (annotated != null) {
- result.add(annotated);
- }
- }
- }
- try {
- file.close();
- } catch (IOException e) {
- // Ignore
- }
- }
-
-
- /**
- * Get class name given a path to a classfile.
- * /my/class/MyClass.class -> my.class.MyClass
- */
- public String getClassName(String filePath) {
- if (filePath.startsWith("/")) {
- filePath = filePath.substring(1);
- }
- if (filePath.endsWith(".class")) {
- filePath = filePath.substring(0, filePath.length() - ".class".length());
- }
- return filePath.replace('/', '.');
- }
-
-
- /**
- * Scan class for interesting annotations.
- */
- public Class<?> scanClass(Context context, String className, File file, JarEntry entry) {
- if (USE_JAVASSIST) {
- // FIXME: Javassist implementation
- try {
-
- return context.getLoader().getClassLoader().loadClass(className);
- } catch (Throwable t) {
- // Ignore classloading errors here
- }
- } else {
- // Load the class using the classloader, and see if it implements one of the web annotations
- try {
- Class<?> clazz = context.getLoader().getClassLoader().loadClass(className);
- if (clazz.isAnnotationPresent(InitParam.class)
- || clazz.isAnnotationPresent(ServletFilter.class)
- || clazz.isAnnotationPresent(WebServlet.class)
- || clazz.isAnnotationPresent(WebServletContextListener.class)) {
- return clazz;
- }
- } catch (Throwable t) {
- // Ignore classloading errors here
- }
- }
- return null;
- }
-
-
-}
Copied: trunk/java/org/apache/catalina/core/BaseAnnotationScanner.java (from rev 925, trunk/java/org/apache/catalina/core/AnnotationScanner.java)
===================================================================
--- trunk/java/org/apache/catalina/core/BaseAnnotationScanner.java (rev 0)
+++ trunk/java/org/apache/catalina/core/BaseAnnotationScanner.java 2009-02-13 15:21:15 UTC (rev 930)
@@ -0,0 +1,221 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.catalina.core;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.jar.JarEntry;
+import java.util.jar.JarFile;
+
+import javax.naming.directory.DirContext;
+
+import org.apache.catalina.AnnotationScanner;
+import org.apache.catalina.Context;
+
+public abstract class BaseAnnotationScanner
+ implements AnnotationScanner {
+
+ /**
+ * Scan the given context's default locations for annotations.
+ *
+ * @param context
+ */
+ public List<Class<?>> scan(Context context) {
+ ArrayList<Class<?>> result = new ArrayList<Class<?>>();
+
+ if (context.getLoader().findLoaderRepositories() != null) {
+ String[] repositories = context.getLoader().findLoaderRepositories();
+ for (int i = 0; i < repositories.length; i++) {
+ if (repositories[i].endsWith(".jar")) {
+ try {
+ scanJar(result, context, new JarFile(repositories[i]));
+ } catch (IOException e) {
+ // Ignore
+ }
+ } else {
+ scanClasses(result, context, new File(repositories[i]), "");
+ }
+ }
+ }
+
+ return result;
+ /*
+ DirContext resources = context.getResources();
+ DirContext webInfClasses = null;
+ DirContext webInfLib = null;
+
+ try {
+ webInfClasses = (DirContext) resources.lookup("/WEB-INF/classes");
+ } catch (Exception e) {
+ // Ignore, /WEB-INF/classes not found, or not a folder
+ }
+ if (webInfClasses != null) {
+ scanClasses(context, webInfClasses, "");
+ }
+
+ try {
+ webInfLib = (DirContext) resources.lookup("/WEB-INF/lib");
+ } catch (Exception e) {
+ // Ignore, /WEB-INF/classes not found, or not a folder
+ }
+ if (webInfLib != null) {
+ scanJars(context, webInfLib);
+ }*/
+
+ }
+
+
+ /**
+ * Scan folder containing class files.
+ */
+ public void scanClasses(List<Class<?>> result, Context context, File folder, String path) {
+ String[] files = folder.list();
+ for (int i = 0; i < files.length; i++) {
+ File file = new File(folder, files[i]);
+ if (file.isDirectory()) {
+ scanClasses(result, context, file, path + "/" + files[i]);
+ } else if (files[i].endsWith(".class")) {
+ String className = getClassName(path + "/" + files[i]);
+ Class<?> annotated = scanClass(context, className, file, null);
+ if (annotated != null) {
+ result.add(annotated);
+ }
+ }
+ }
+ }
+
+
+ /**
+ * Scan folder containing class files.
+ */
+ /*
+ public static void scanClasses(Context context, DirContext folder, String path) {
+ try {
+ NamingEnumeration<Binding> enumeration = folder.listBindings(path);
+ while (enumeration.hasMore()) {
+ Binding binding = enumeration.next();
+ Object object = binding.getObject();
+
+ if (object instanceof Resource) {
+ // This is a class, so we should load it
+ String className = getClassName(path + "/" + binding.getName());
+ scanClass(context, className, (Resource) object, null, null);
+ } else if (object instanceof DirContext) {
+ scanClasses(context, folder, path + "/" + binding.getName());
+ }
+
+ }
+ } catch (NamingException e) {
+ // Ignore for now
+ e.printStackTrace();
+ }
+ }*/
+
+
+ /**
+ * Scan folder containing JAR files.
+ */
+ public void scanJars(List<Class<?>> result, Context context, DirContext folder) {
+ if (context.getLoader().findLoaderRepositories() != null) {
+ String[] repositories = context.getLoader().findLoaderRepositories();
+ for (int i = 0; i < repositories.length; i++) {
+ if (repositories[i].endsWith(".jar")) {
+ try {
+ scanJar(result, context, new JarFile(repositories[i]));
+ } catch (IOException e) {
+ // Ignore
+ }
+ }
+ }
+ }
+ /*else {
+ try {
+ NamingEnumeration<Binding> enumeration = folder.listBindings("");
+ while (enumeration.hasMore()) {
+ Binding binding = enumeration.next();
+ Object object = binding.getObject();
+
+ if (object instanceof Resource && binding.getName().endsWith(".jar")) {
+ // This is normally a JAR, put it in the work folder
+ File destDir = null;
+ File workDir =
+ (File) context.getServletContext().getAttribute(Globals.WORK_DIR_ATTR);
+ destDir = new File(workDir, "WEB-INF/lib");
+ destDir.mkdirs();
+ File destFile = new File(destDir, binding.getName());
+
+ scanJar(context, (Resource) object);
+ }
+
+ }
+ } catch (NamingException e) {
+ // Ignore for now
+ e.printStackTrace();
+ }
+ }*/
+ }
+
+
+ /**
+ * Scan all class files in the given JAR.
+ */
+ public void scanJar(List<Class<?>> result, Context context, JarFile file) {
+ Enumeration<JarEntry> entries = file.entries();
+ while (entries.hasMoreElements()) {
+ JarEntry entry = entries.nextElement();
+ if (entry.getName().endsWith(".class")) {
+ Class<?> annotated = scanClass(context, getClassName(entry.getName()), null, entry);
+ if (annotated != null) {
+ result.add(annotated);
+ }
+ }
+ }
+ try {
+ file.close();
+ } catch (IOException e) {
+ // Ignore
+ }
+ }
+
+
+ /**
+ * Get class name given a path to a classfile.
+ * /my/class/MyClass.class -> my.class.MyClass
+ */
+ public String getClassName(String filePath) {
+ if (filePath.startsWith("/")) {
+ filePath = filePath.substring(1);
+ }
+ if (filePath.endsWith(".class")) {
+ filePath = filePath.substring(0, filePath.length() - ".class".length());
+ }
+ return filePath.replace('/', '.');
+ }
+
+
+ /**
+ * Scan class for interesting annotations.
+ */
+ public abstract Class<?> scanClass(Context context, String className, File file, JarEntry entry);
+
+
+}
Property changes on: trunk/java/org/apache/catalina/core/BaseAnnotationScanner.java
___________________________________________________________________
Name: svn:mergeinfo
+
Added: trunk/java/org/apache/catalina/core/ClassLoadingAnnotationScanner.java
===================================================================
--- trunk/java/org/apache/catalina/core/ClassLoadingAnnotationScanner.java (rev 0)
+++ trunk/java/org/apache/catalina/core/ClassLoadingAnnotationScanner.java 2009-02-13 15:21:15 UTC (rev 930)
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.catalina.core;
+
+import java.io.File;
+import java.util.jar.JarEntry;
+
+import javax.servlet.annotation.InitParam;
+import javax.servlet.annotation.ServletFilter;
+import javax.servlet.annotation.WebServlet;
+import javax.servlet.annotation.WebServletContextListener;
+
+import org.apache.catalina.Context;
+
+public class ClassLoadingAnnotationScanner
+ extends BaseAnnotationScanner {
+
+ /**
+ * Scan class for interesting annotations.
+ */
+ public Class<?> scanClass(Context context, String className, File file, JarEntry entry) {
+ // Load the class using the classloader, and see if it implements one of the web annotations
+ try {
+ Class<?> clazz = context.getLoader().getClassLoader().loadClass(className);
+ if (clazz.isAnnotationPresent(InitParam.class)
+ || clazz.isAnnotationPresent(ServletFilter.class)
+ || clazz.isAnnotationPresent(WebServlet.class)
+ || clazz.isAnnotationPresent(WebServletContextListener.class)) {
+ return clazz;
+ }
+ } catch (Throwable t) {
+ // Ignore classloading errors here
+ }
+ return null;
+ }
+
+
+}
Added: trunk/java/org/apache/catalina/core/JavassistAnnotationScanner.java
===================================================================
--- trunk/java/org/apache/catalina/core/JavassistAnnotationScanner.java (rev 0)
+++ trunk/java/org/apache/catalina/core/JavassistAnnotationScanner.java 2009-02-13 15:21:15 UTC (rev 930)
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.catalina.core;
+
+import java.io.File;
+import java.util.jar.JarEntry;
+
+import org.apache.catalina.Context;
+
+public class JavassistAnnotationScanner
+ extends BaseAnnotationScanner {
+
+ /**
+ * Scan class for interesting annotations.
+ */
+ public Class<?> scanClass(Context context, String className, File file, JarEntry entry) {
+ // FIXME: Javassist impl
+ return null;
+ }
+
+
+}
Modified: trunk/webapps/docs/changelog.xml
===================================================================
--- trunk/webapps/docs/changelog.xml 2009-02-13 15:19:22 UTC (rev 929)
+++ trunk/webapps/docs/changelog.xml 2009-02-13 15:21:15 UTC (rev 930)
@@ -60,6 +60,9 @@
<fix>
<bug>39013</bug>: Fix appBase test when deleting resources. (markt)
</fix>
+ <fix>
+ Status code for redirect rule in rewrite valve. (jfclere)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
15 years, 10 months
JBossWeb SVN: r929 - in branches/2.1.x: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-02-13 10:19:22 -0500 (Fri, 13 Feb 2009)
New Revision: 929
Modified:
branches/2.1.x/java/org/jboss/web/rewrite/RewriteValve.java
branches/2.1.x/webapps/docs/changelog.xml
Log:
- Port RewriteValve patch.
Modified: branches/2.1.x/java/org/jboss/web/rewrite/RewriteValve.java
===================================================================
--- branches/2.1.x/java/org/jboss/web/rewrite/RewriteValve.java 2009-02-12 09:28:16 UTC (rev 928)
+++ branches/2.1.x/java/org/jboss/web/rewrite/RewriteValve.java 2009-02-13 15:19:22 UTC (rev 929)
@@ -349,6 +349,7 @@
urlString.insert(0, request.getContext().getEncodedPath());
}
response.sendRedirect(urlString.toString());
+ response.setStatus(rules[i].getRedirectCode());
done = true;
break;
}
Modified: branches/2.1.x/webapps/docs/changelog.xml
===================================================================
--- branches/2.1.x/webapps/docs/changelog.xml 2009-02-12 09:28:16 UTC (rev 928)
+++ branches/2.1.x/webapps/docs/changelog.xml 2009-02-13 15:19:22 UTC (rev 929)
@@ -36,6 +36,9 @@
<fix>
<bug>39013</bug>: Fix appBase test when deleting resources. (markt)
</fix>
+ <fix>
+ Status code for redirect rule in rewrite valve. (jfclere)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
15 years, 10 months
JBossWeb SVN: r928 - trunk/java/org/jboss/web/rewrite.
by jbossweb-commits@lists.jboss.org
Author: jfrederic.clere(a)jboss.com
Date: 2009-02-12 04:28:16 -0500 (Thu, 12 Feb 2009)
New Revision: 928
Modified:
trunk/java/org/jboss/web/rewrite/RewriteValve.java
Log:
Allow the R=code to work (was always 302).
Modified: trunk/java/org/jboss/web/rewrite/RewriteValve.java
===================================================================
--- trunk/java/org/jboss/web/rewrite/RewriteValve.java 2009-02-10 07:44:41 UTC (rev 927)
+++ trunk/java/org/jboss/web/rewrite/RewriteValve.java 2009-02-12 09:28:16 UTC (rev 928)
@@ -111,7 +111,7 @@
public void start() throws LifecycleException {
InputStream is = null;
-
+
// Process configuration file for this valve
if (getContainer() instanceof Context) {
context = true;
@@ -348,6 +348,7 @@
urlString.insert(0, request.getContext().getEncodedPath());
}
response.sendRedirect(urlString.toString());
+ response.setStatus(rules[i].getRedirectCode());
done = true;
break;
}
15 years, 10 months
JBossWeb SVN: r927 - branches/JBOSSWEB_2_0_0_GA_CP05_JBPAPP-1617/src/share/classes/org/apache/tomcat/util/net.
by jbossweb-commits@lists.jboss.org
Author: galder.zamarreno(a)jboss.com
Date: 2009-02-10 02:44:41 -0500 (Tue, 10 Feb 2009)
New Revision: 927
Modified:
branches/JBOSSWEB_2_0_0_GA_CP05_JBPAPP-1617/src/share/classes/org/apache/tomcat/util/net/AprEndpoint.java
Log:
[JBPAPP-1617] Backport was done incorrect. Fix it properly.
Modified: branches/JBOSSWEB_2_0_0_GA_CP05_JBPAPP-1617/src/share/classes/org/apache/tomcat/util/net/AprEndpoint.java
===================================================================
--- branches/JBOSSWEB_2_0_0_GA_CP05_JBPAPP-1617/src/share/classes/org/apache/tomcat/util/net/AprEndpoint.java 2009-02-09 19:55:56 UTC (rev 926)
+++ branches/JBOSSWEB_2_0_0_GA_CP05_JBPAPP-1617/src/share/classes/org/apache/tomcat/util/net/AprEndpoint.java 2009-02-10 07:44:41 UTC (rev 927)
@@ -726,14 +726,6 @@
workers = new WorkerStack(maxThreads);
}
- // Start acceptor threads
- for (int i = 0; i < acceptorThreadCount; i++) {
- Thread acceptorThread = new Thread(new Acceptor(), getName() + "-Acceptor-" + i);
- acceptorThread.setPriority(threadPriority);
- acceptorThread.setDaemon(daemon);
- acceptorThread.start();
- }
-
// Start poller threads
pollers = new Poller[pollerThreadCount];
for (int i = 0; i < pollerThreadCount; i++) {
15 years, 10 months
JBossWeb SVN: r926 - in branches/2.1.x: webapps/docs and 1 other directory.
by jbossweb-commits@lists.jboss.org
Author: remy.maucherat(a)jboss.com
Date: 2009-02-09 14:55:56 -0500 (Mon, 09 Feb 2009)
New Revision: 926
Modified:
branches/2.1.x/java/org/apache/catalina/startup/ContextConfig.java
branches/2.1.x/java/org/apache/catalina/startup/HostConfig.java
branches/2.1.x/webapps/docs/changelog.xml
Log:
- Two fixes for appBase matching in standalone.
Modified: branches/2.1.x/java/org/apache/catalina/startup/ContextConfig.java
===================================================================
--- branches/2.1.x/java/org/apache/catalina/startup/ContextConfig.java 2009-02-09 19:55:07 UTC (rev 925)
+++ branches/2.1.x/java/org/apache/catalina/startup/ContextConfig.java 2009-02-09 19:55:56 UTC (rev 926)
@@ -906,7 +906,7 @@
}
}
- if (docBase.startsWith(canonicalAppBase.getPath())) {
+ if (docBase.startsWith(canonicalAppBase.getPath() + File.separatorChar)) {
docBase = docBase.substring(canonicalAppBase.getPath().length());
docBase = docBase.replace(File.separatorChar, '/');
if (docBase.startsWith("/")) {
Modified: branches/2.1.x/java/org/apache/catalina/startup/HostConfig.java
===================================================================
--- branches/2.1.x/java/org/apache/catalina/startup/HostConfig.java 2009-02-09 19:55:07 UTC (rev 925)
+++ branches/2.1.x/java/org/apache/catalina/startup/HostConfig.java 2009-02-09 19:55:56 UTC (rev 926)
@@ -1079,7 +1079,7 @@
try {
File current = new File(resources[j]);
current = current.getCanonicalFile();
- if ((current.getAbsolutePath().startsWith(appBase().getAbsolutePath()))
+ if ((current.getAbsolutePath().startsWith(appBase().getAbsolutePath() + File.separator))
|| (current.getAbsolutePath().startsWith(configBase().getAbsolutePath()))) {
if (log.isDebugEnabled())
log.debug("Delete " + current);
@@ -1120,7 +1120,7 @@
try {
File current = new File(resources[j]);
current = current.getCanonicalFile();
- if ((current.getAbsolutePath().startsWith(appBase().getAbsolutePath()))
+ if ((current.getAbsolutePath().startsWith(appBase().getAbsolutePath() + File.separator))
|| (current.getAbsolutePath().startsWith(configBase().getAbsolutePath()))) {
if (log.isDebugEnabled())
log.debug("Delete " + current);
@@ -1138,7 +1138,7 @@
try {
File current = new File(resources2[j]);
current = current.getCanonicalFile();
- if ((current.getAbsolutePath().startsWith(appBase().getAbsolutePath()))
+ if ((current.getAbsolutePath().startsWith(appBase().getAbsolutePath() + File.separator))
|| ((current.getAbsolutePath().startsWith(configBase().getAbsolutePath())
&& (current.getAbsolutePath().endsWith(".xml"))))) {
if (log.isDebugEnabled())
Modified: branches/2.1.x/webapps/docs/changelog.xml
===================================================================
--- branches/2.1.x/webapps/docs/changelog.xml 2009-02-09 19:55:07 UTC (rev 925)
+++ branches/2.1.x/webapps/docs/changelog.xml 2009-02-09 19:55:56 UTC (rev 926)
@@ -30,6 +30,12 @@
<fix>
<bug>46606</bug>: Max depth limit configurable in WebDAV Servlet. (markt)
</fix>
+ <fix>
+ <bug>38570</bug>: Fix checking of appBase against docBase. (markt)
+ </fix>
+ <fix>
+ <bug>39013</bug>: Fix appBase test when deleting resources. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
15 years, 10 months