Author: markt Date: Tue Jan 6 07:15:32 2009 New Revision: 731967 URL: http://svn.apache.org/viewvc?rev=731967&view=rev Log: First attempt at updating the javax.servlet package for the 3.0 spec It compiles and runs but 99.9% of the implementation is stubbed out and marked with TODO SERVLET3
Added: tomcat/trunk/java/javax/servlet/AsyncContext.java (with props) tomcat/trunk/java/javax/servlet/AsyncEvent.java (with props) tomcat/trunk/java/javax/servlet/AsyncListener.java (with props) tomcat/trunk/java/javax/servlet/DispatcherType.java (with props) tomcat/trunk/java/javax/servlet/SessionCookieConfig.java (with props) tomcat/trunk/java/javax/servlet/SessionTrackingMode.java (with props) tomcat/trunk/java/javax/servlet/annotation/ tomcat/trunk/java/javax/servlet/annotation/InitParam.java (with props) tomcat/trunk/java/javax/servlet/annotation/ServletFilter.java (with props) tomcat/trunk/java/javax/servlet/annotation/WebServlet.java (with props) tomcat/trunk/java/javax/servlet/annotation/WebServletContextListener.java (with props) Modified: tomcat/trunk/TOMCAT-7-RELEASE-PLAN.txt tomcat/trunk/build.properties.default tomcat/trunk/java/javax/servlet/ServletContext.java tomcat/trunk/java/javax/servlet/ServletRequest.java tomcat/trunk/java/javax/servlet/ServletRequestWrapper.java tomcat/trunk/java/javax/servlet/http/Cookie.java tomcat/trunk/java/org/apache/catalina/connector/Request.java tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java tomcat/trunk/java/org/apache/catalina/core/ApplicationContextFacade.java tomcat/trunk/java/org/apache/catalina/core/Constants.java tomcat/trunk/java/org/apache/catalina/core/DummyRequest.java tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java Modified: tomcat/trunk/TOMCAT-7-RELEASE-PLAN.txt URL: http://svn.apache.org/viewvc/tomcat/trunk/TOMCAT-7-RELEASE-PLAN.txt?rev=731967&r1=731966&r2=731967&view=diff ============================================================================== --- tomcat/trunk/TOMCAT-7-RELEASE-PLAN.txt (original) +++ tomcat/trunk/TOMCAT-7-RELEASE-PLAN.txt Tue Jan 6 07:15:32 2009 @@ -22,8 +22,10 @@ ===================================================== 1. Update trunk with new API from Servlet Spec 3.0 PR + - Done 2. Provide NOOP implementations with TODO SRV3 markers so it will build + - Done 3. Implement all the new Servlet 3 features Modified: tomcat/trunk/build.properties.default URL: http://svn.apache.org/viewvc/tomcat/trunk/build.properties.default?rev=731967&r1=731966&r2=731967&view=diff ============================================================================== --- tomcat/trunk/build.properties.default (original) +++ tomcat/trunk/build.properties.default Tue Jan 6 07:15:32 2009 @@ -25,7 +25,7 @@ # ----------------------------------------------------------------------------- # ----- Vesion Control Flags ----- -version.major=6 +version.major=7 version.minor=0 version.build=0 version.patch=0 Added: tomcat/trunk/java/javax/servlet/AsyncContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/AsyncContext.java?rev=731967&view=auto ============================================================================== --- tomcat/trunk/java/javax/servlet/AsyncContext.java (added) +++ tomcat/trunk/java/javax/servlet/AsyncContext.java Tue Jan 6 07:15:32 2009 @@ -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 javax.servlet; + +/** + * @since 3.0 + * $Id$ + * TODO SERVLET3 + */ +public interface AsyncContext { + ServletRequest getRequest(); + ServletResponse getResponse(); + boolean hasOriginalRequestAndResponse(); + void forward(); + void forward(String path); + void forward(ServletContext context, String path); + void complete(); + void start(Runnable run); +} Propchange: tomcat/trunk/java/javax/servlet/AsyncContext.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: tomcat/trunk/java/javax/servlet/AsyncContext.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision Added: tomcat/trunk/java/javax/servlet/AsyncEvent.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/AsyncEvent.java?rev=731967&view=auto ============================================================================== --- tomcat/trunk/java/javax/servlet/AsyncEvent.java (added) +++ tomcat/trunk/java/javax/servlet/AsyncEvent.java Tue Jan 6 07:15:32 2009 @@ -0,0 +1,40 @@ +/* +* 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; + +/** + * @since 3.0 + * $Id$ + * TODO SERVLET3 + */ +public class AsyncEvent { + private ServletRequest request; + private ServletResponse response; + + AsyncEvent(ServletRequest request, ServletResponse response) { + this.request = request; + this.response = response; + } + + public ServletRequest getRequest() { + return request; + } + + public ServletResponse getResponse() { + return response; + } +} Propchange: tomcat/trunk/java/javax/servlet/AsyncEvent.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: tomcat/trunk/java/javax/servlet/AsyncEvent.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision Added: tomcat/trunk/java/javax/servlet/AsyncListener.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/AsyncListener.java?rev=731967&view=auto ============================================================================== --- tomcat/trunk/java/javax/servlet/AsyncListener.java (added) +++ tomcat/trunk/java/javax/servlet/AsyncListener.java Tue Jan 6 07:15:32 2009 @@ -0,0 +1,29 @@ +/* +* 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; + +/** + * @since 3.0 + * $Id$ + * TODO SERVLET3 + */ +public interface AsyncListener { + void onComplete(AsyncEvent event) throws IOException; + void onTimeout(AsyncEvent event) throws IOException; +} Propchange: tomcat/trunk/java/javax/servlet/AsyncListener.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: tomcat/trunk/java/javax/servlet/AsyncListener.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision Added: tomcat/trunk/java/javax/servlet/DispatcherType.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/DispatcherType.java?rev=731967&view=auto ============================================================================== --- tomcat/trunk/java/javax/servlet/DispatcherType.java (added) +++ tomcat/trunk/java/javax/servlet/DispatcherType.java Tue Jan 6 07:15:32 2009 @@ -0,0 +1,29 @@ +/* +* 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; + +/** + * @since 3.0 + * $Id$ + * TODO SERVLET3 + */ +public enum DispatcherType { + FORWARD, + INCLUDE, + REQUEST, + ERROR +} Propchange: tomcat/trunk/java/javax/servlet/DispatcherType.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: tomcat/trunk/java/javax/servlet/DispatcherType.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision Modified: tomcat/trunk/java/javax/servlet/ServletContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ServletContext.java?rev=731967&r1=731966&r2=731967&view=diff ============================================================================== --- tomcat/trunk/java/javax/servlet/ServletContext.java (original) +++ tomcat/trunk/java/javax/servlet/ServletContext.java Tue Jan 6 07:15:32 2009 @@ -19,7 +19,9 @@ import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; +import java.util.EnumSet; import java.util.Enumeration; +import java.util.Map; import java.util.Set; @@ -90,10 +92,10 @@ /** * Returns the major version of the Java Servlet API that this * servlet container supports. All implementations that comply - * with Version 2.4 must have this method - * return the integer 2. + * with Version 3.0 must have this method + * return the integer 3. * - * @return 2 + * @return 3 * */ @@ -104,10 +106,10 @@ /** * Returns the minor version of the Servlet API that this * servlet container supports. All implementations that comply - * with Version 2.4 must have this method - * return the integer 4. + * with Version 3.0 must have this method + * return the integer 0. * - * @return 4 + * @return 0 * */ @@ -641,6 +643,87 @@ */ public String getServletContextName(); + + /** + * + * @param servletName + * @param urlPatterns + * @since 3.0 + */ + public void addServletMapping(String servletName, String[] urlPatterns); + + /** + * + * @param filterName + * @param description + * @param className + * @param initParameters + * @param isAsyncSupported + * @since 3.0 + */ + public void addFilter(String filterName, String description, + String className, Map<String,String> initParameters, + boolean isAsyncSupported); + + /** + * + * @param filterName + * @param dispatcherTypes + * @param isMatchAfter + * @param servletNames + * @since 3.0 + */ + public void addFilterMappingForServletNames(String filterName, + EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, + String... servletNames); + + /** + * + * @param filterName + * @param dispatcherTypes + * @param isMatchAfter + * @param urlPatterns + * @since 3.0 + */ + public void addFilterMappingForUrlPatterns(String filterName, + EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, + String... urlPatterns); + + /** + * + * @param sessionCookieConfig + * @since 3.0 + */ + public void setSessionCookieConfig(SessionCookieConfig sessionCookieConfig); + + /** + * + * @return + * @since 3.0 + */ + public SessionCookieConfig getSessionCookieConfig(); + + /** + * + * @param sessionTrackingModes + * @since 3.0 + */ + public void setSessionTrackingModes( + EnumSet<SessionTrackingMode> sessionTrackingModes); + + /** + * + * @return + * @since 3.0 + */ + public EnumSet<SessionTrackingMode> getDefaultSessionTrackingModes(); + + /** + * + * @return + * @since 3.0 + */ + public EnumSet<SessionTrackingMode> getEffectiveSessionTrackingModes(); } Modified: tomcat/trunk/java/javax/servlet/ServletRequest.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ServletRequest.java?rev=731967&r1=731966&r2=731967&view=diff ============================================================================== --- tomcat/trunk/java/javax/servlet/ServletRequest.java (original) +++ tomcat/trunk/java/javax/servlet/ServletRequest.java Tue Jan 6 07:15:32 2009 @@ -594,5 +594,76 @@ */ public int getLocalPort(); + /** + * + * @return + * @since 3.0 + */ + public ServletContext getServletContext(); + + /** + * + * @return + * @throws java.lang.IllegalStateException + * @since 3.0 + */ + public AsyncContext startAsync() throws java.lang.IllegalStateException; + + /** + * + * @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(); + + /** + * + * @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); } Modified: tomcat/trunk/java/javax/servlet/ServletRequestWrapper.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/ServletRequestWrapper.java?rev=731967&r1=731966&r2=731967&view=diff ============================================================================== --- tomcat/trunk/java/javax/servlet/ServletRequestWrapper.java (original) +++ tomcat/trunk/java/javax/servlet/ServletRequestWrapper.java Tue Jan 6 07:15:32 2009 @@ -396,6 +396,116 @@ public int getLocalPort(){ return this.request.getLocalPort(); } + + /** + * The default behavior of this method is to return + * getServletContext() on the wrapped request object. + * + * @return + * @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 + * @since 3.0 + */ + public AsyncContext startAsync() throws java.lang.IllegalStateException { + return request.startAsync(); + } + + /** + * 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); + } + + /** + * The default behavior of this method is to return + * isAsyncStarted() on the wrapped request object. + * + * @return + * @since 3.0 + */ + 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(); + } + + /** + * 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); + } + /** + * 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); + } + + /** + * 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); + } + } Added: tomcat/trunk/java/javax/servlet/SessionCookieConfig.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/SessionCookieConfig.java?rev=731967&view=auto ============================================================================== --- tomcat/trunk/java/javax/servlet/SessionCookieConfig.java (added) +++ tomcat/trunk/java/javax/servlet/SessionCookieConfig.java Tue Jan 6 07:15:32 2009 @@ -0,0 +1,60 @@ +/* + * 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; + +/** + * + * @since 3.0 + * $Id$ + * TODO SERVLET3 + */ +public class SessionCookieConfig { + private String domain; + private String path; + private String comment; + private boolean isHttpOnly; + private boolean isSecure; + + public SessionCookieConfig(String domain, String path, String comment, + boolean isHttpOnly, boolean isSecure) { + this.domain = domain; + this.path = path; + this.comment = comment; + this.isHttpOnly = isHttpOnly; + this.isSecure = isSecure; + } + + public java.lang.String getDomain() { + return domain; + } + + public java.lang.String getPath() { + return path; + } + + public java.lang.String getComment() { + return comment; + } + + public boolean isHttpOnly() { + return isHttpOnly; + } + + public boolean isSecure() { + return isSecure; + } +} Propchange: tomcat/trunk/java/javax/servlet/SessionCookieConfig.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: tomcat/trunk/java/javax/servlet/SessionCookieConfig.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision Added: tomcat/trunk/java/javax/servlet/SessionTrackingMode.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/SessionTrackingMode.java?rev=731967&view=auto ============================================================================== --- tomcat/trunk/java/javax/servlet/SessionTrackingMode.java (added) +++ tomcat/trunk/java/javax/servlet/SessionTrackingMode.java Tue Jan 6 07:15:32 2009 @@ -0,0 +1,28 @@ +/* +* 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; + +/** + * @since 3.0 + * $Id$ + * TODO SERVLET3 + */ +public enum SessionTrackingMode { + COOKIE, + URL, + SSL +} Propchange: tomcat/trunk/java/javax/servlet/SessionTrackingMode.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: tomcat/trunk/java/javax/servlet/SessionTrackingMode.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision Added: tomcat/trunk/java/javax/servlet/annotation/InitParam.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/annotation/InitParam.java?rev=731967&view=auto ============================================================================== --- tomcat/trunk/java/javax/servlet/annotation/InitParam.java (added) +++ tomcat/trunk/java/javax/servlet/annotation/InitParam.java Tue Jan 6 07:15:32 2009 @@ -0,0 +1,37 @@ +/* + * 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.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.lang.annotation.Documented; + +/** + * @since 3.0 + * $Id$ + * TODO SERVLET3 + */ +...@target({ElementType.TYPE}) +...@retention(RetentionPolicy.RUNTIME) +...@documented +public @interface InitParam { + String name(); + String value(); + String description() default ""; +} Propchange: tomcat/trunk/java/javax/servlet/annotation/InitParam.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: tomcat/trunk/java/javax/servlet/annotation/InitParam.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision Added: tomcat/trunk/java/javax/servlet/annotation/ServletFilter.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/annotation/ServletFilter.java?rev=731967&view=auto ============================================================================== --- tomcat/trunk/java/javax/servlet/annotation/ServletFilter.java (added) +++ tomcat/trunk/java/javax/servlet/annotation/ServletFilter.java Tue Jan 6 07:15:32 2009 @@ -0,0 +1,47 @@ +/* + * 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.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.lang.annotation.Documented; + +import javax.servlet.DispatcherType; + +/** + * @since 3.0 + * $Id$ + * TODO SERVLET3 + */ +...@target({ElementType.TYPE}) +...@retention(RetentionPolicy.RUNTIME) +...@documented +public @interface ServletFilter { + String description() default ""; + String displayName() default ""; + InitParam[] initParams() default {}; + String filterName() default ""; + String icon() default ""; + String[] servletNames() default {}; + String[] value() default {}; + String[] urlPatterns() default {}; + DispatcherType[] dispatcherTypes() default {DispatcherType.REQUEST}; + boolean asyncSupported() default false; + long asyncTimeout() default 60000L; +} Propchange: tomcat/trunk/java/javax/servlet/annotation/ServletFilter.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: tomcat/trunk/java/javax/servlet/annotation/ServletFilter.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision Added: tomcat/trunk/java/javax/servlet/annotation/WebServlet.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/annotation/WebServlet.java?rev=731967&view=auto ============================================================================== --- tomcat/trunk/java/javax/servlet/annotation/WebServlet.java (added) +++ tomcat/trunk/java/javax/servlet/annotation/WebServlet.java Tue Jan 6 07:15:32 2009 @@ -0,0 +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. + */ +package javax.servlet.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.lang.annotation.Documented; + +/** + * @since 3.0 + * $Id$ + * TODO SERVLET3 + */ +...@target({ElementType.TYPE}) +...@retention(RetentionPolicy.RUNTIME) +...@documented +public @interface WebServlet { + String name() default ""; + String[] value() default {}; + String[] urlPatterns() default {}; + int loadOnStartup() default -1; + InitParam[] initParams() default {}; + boolean asyncSupported() default false; + long asyncTimeout() default 60000L; + String icon() default ""; + String description() default ""; +} Propchange: tomcat/trunk/java/javax/servlet/annotation/WebServlet.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: tomcat/trunk/java/javax/servlet/annotation/WebServlet.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision Added: tomcat/trunk/java/javax/servlet/annotation/WebServletContextListener.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/annotation/WebServletContextListener.java?rev=731967&view=auto ============================================================================== --- tomcat/trunk/java/javax/servlet/annotation/WebServletContextListener.java (added) +++ tomcat/trunk/java/javax/servlet/annotation/WebServletContextListener.java Tue Jan 6 07:15:32 2009 @@ -0,0 +1,35 @@ +/* + * 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.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.lang.annotation.Documented; + +/** + * @since 3.0 + * $Id$ + * TODO SERVLET3 + */ +...@target({ElementType.TYPE}) +...@retention(RetentionPolicy.RUNTIME) +...@documented +public @interface WebServletContextListener { + String description() default ""; +} Propchange: tomcat/trunk/java/javax/servlet/annotation/WebServletContextListener.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: tomcat/trunk/java/javax/servlet/annotation/WebServletContextListener.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision Modified: tomcat/trunk/java/javax/servlet/http/Cookie.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/http/Cookie.java?rev=731967&r1=731966&r2=731967&view=diff ============================================================================== --- tomcat/trunk/java/javax/servlet/http/Cookie.java (original) +++ tomcat/trunk/java/javax/servlet/http/Cookie.java Tue Jan 6 07:15:32 2009 @@ -19,6 +19,8 @@ import java.text.MessageFormat; import java.util.ResourceBundle; +import javax.servlet.DispatcherType; + /** * * Creates a cookie, a small amount of information sent by a servlet to @@ -81,14 +83,15 @@ // 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 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 + // TODO SERVLET3 + private boolean httpOnly; // Not in the spec but supported by most browsers /** @@ -533,5 +536,23 @@ throw new RuntimeException(e.getMessage()); } } + + /** + * + * @return + * @since 3.0 + */ + public boolean isHttpOnly() { + return httpOnly; + } + + /** + * + * @param httpOnly + * since 3.0 + */ + public void setHttpOnly(boolean httpOnly) { + this.httpOnly = httpOnly; + } } Modified: tomcat/trunk/java/org/apache/catalina/connector/Request.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Request.java?rev=731967&r1=731966&r2=731967&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Tue Jan 6 07:15:32 2009 @@ -35,12 +35,16 @@ import java.util.TreeMap; import javax.security.auth.Subject; +import javax.servlet.AsyncContext; +import javax.servlet.AsyncListener; import javax.servlet.FilterChain; import javax.servlet.RequestDispatcher; import javax.servlet.ServletContext; import javax.servlet.ServletInputStream; +import javax.servlet.ServletRequest; import javax.servlet.ServletRequestAttributeEvent; import javax.servlet.ServletRequestAttributeListener; +import javax.servlet.ServletResponse; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; @@ -1485,6 +1489,50 @@ } + public void addAsyncListener(AsyncListener listener, + ServletRequest servletRequest, ServletResponse servletResponse) { + // TODO SERVLET3 + } + + public void addAsyncListener(AsyncListener listener) { + // TODO SERVLET3 + } + + public AsyncContext getAsyncContext() { + // TODO SERVLET3 + return null; + } + + public ServletContext getServletContext() { + // TODO SERVLET3 + return null; + } + + public boolean isAsyncStarted() { + // TODO SERVLET3 + return false; + } + + public boolean isAsyncSupported() { + // TODO SERVLET3 + return false; + } + + public void setAsyncTimeout(long timeout) { + // TODO SERVLET3 + } + + public AsyncContext startAsync() throws IllegalStateException { + // TODO SERVLET3 + return null; + } + + public AsyncContext startAsync(ServletRequest servletRequest, + ServletResponse servletResponse) throws IllegalStateException { + // TODO SERVLET3 + return null; + } + // ---------------------------------------------------- HttpRequest Methods Modified: tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java?rev=731967&r1=731966&r2=731967&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/RequestFacade.java Tue Jan 6 07:15:32 2009 @@ -26,8 +26,13 @@ import java.util.Locale; import java.util.Map; +import javax.servlet.AsyncContext; +import javax.servlet.AsyncListener; import javax.servlet.RequestDispatcher; +import javax.servlet.ServletContext; import javax.servlet.ServletInputStream; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; @@ -932,4 +937,57 @@ return request.getRemotePort(); } + + public void addAsyncListener(AsyncListener listener, + ServletRequest servletRequest, ServletResponse servletResponse) { + // TODO SERVLET3 + } + + + public void addAsyncListener(AsyncListener listener) { + // TODO SERVLET3 + } + + + public AsyncContext getAsyncContext() { + // TODO SERVLET3 + return null; + } + + + public ServletContext getServletContext() { + // TODO SERVLET3 + return null; + } + + + public boolean isAsyncStarted() { + // TODO SERVLET3 + return false; + } + + + public boolean isAsyncSupported() { + // TODO SERVLET3 + return false; + } + + + public void setAsyncTimeout(long timeout) { + // TODO SERVLET3 + } + + + public AsyncContext startAsync() throws IllegalStateException { + // TODO SERVLET3 + return null; + } + + + public AsyncContext startAsync(ServletRequest servletRequest, + ServletResponse servletResponse) throws IllegalStateException { + // TODO SERVLET3 + return null; + } + } Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java?rev=731967&r1=731966&r2=731967&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java Tue Jan 6 07:15:32 2009 @@ -24,6 +24,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; +import java.util.EnumSet; import java.util.Enumeration; import java.util.Iterator; import java.util.Map; @@ -33,11 +34,14 @@ import javax.naming.Binding; import javax.naming.NamingException; import javax.naming.directory.DirContext; +import javax.servlet.DispatcherType; import javax.servlet.RequestDispatcher; import javax.servlet.Servlet; import javax.servlet.ServletContext; import javax.servlet.ServletContextAttributeEvent; import javax.servlet.ServletContextAttributeListener; +import javax.servlet.SessionCookieConfig; +import javax.servlet.SessionTrackingMode; import org.apache.catalina.Context; import org.apache.catalina.Host; @@ -805,6 +809,61 @@ } + public void addFilter(String filterName, String description, + String className, Map<String, String> initParameters, + boolean isAsyncSupported) { + // TODO SERVLET3 + } + + + public void addFilterMappingForServletNames(String filterName, + EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, + String... servletNames) { + // TODO SERVLET3 + } + + + public void addFilterMappingForUrlPatterns(String filterName, + EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, + String... urlPatterns) { + // TODO SERVLET3 + } + + + public void addServletMapping(String servletName, String[] urlPatterns) { + // TODO SERVLET3 + } + + + public EnumSet<SessionTrackingMode> getDefaultSessionTrackingModes() { + // TODO SERVLET3 + return null; + } + + + public EnumSet<SessionTrackingMode> getEffectiveSessionTrackingModes() { + // TODO SERVLET3 + return null; + } + + + public SessionCookieConfig getSessionCookieConfig() { + // TODO SERVLET3 + return null; + } + + + public void setSessionCookieConfig(SessionCookieConfig sessionCookieConfig) { + // TODO SERVLET3 + } + + + public void setSessionTrackingModes( + EnumSet<SessionTrackingMode> sessionTrackingModes) { + // TODO SERVLET3 + } + + // -------------------------------------------------------- Package Methods protected StandardContext getContext() { return this.context; Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationContextFacade.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationContextFacade.java?rev=731967&r1=731966&r2=731967&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/core/ApplicationContextFacade.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/ApplicationContextFacade.java Tue Jan 6 07:15:32 2009 @@ -27,14 +27,19 @@ import java.security.AccessController; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; +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.RequestDispatcher; import javax.servlet.Servlet; import javax.servlet.ServletContext; import javax.servlet.ServletException; +import javax.servlet.SessionCookieConfig; +import javax.servlet.SessionTrackingMode; import org.apache.catalina.Globals; import org.apache.catalina.security.SecurityUtil; @@ -364,6 +369,61 @@ } + public void addFilter(String filterName, String description, + String className, Map<String, String> initParameters, + boolean isAsyncSupported) { + // TODO SERVLET3 + } + + + public void addFilterMappingForServletNames(String filterName, + EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, + String... servletNames) { + // TODO SERVLET3 + } + + + public void addFilterMappingForUrlPatterns(String filterName, + EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, + String... urlPatterns) { + // TODO SERVLET3 + } + + + public void addServletMapping(String servletName, String[] urlPatterns) { + // TODO SERVLET3 + } + + + public EnumSet<SessionTrackingMode> getDefaultSessionTrackingModes() { + // TODO SERVLET3 + return null; + } + + + public EnumSet<SessionTrackingMode> getEffectiveSessionTrackingModes() { + // TODO SERVLET3 + return null; + } + + + public SessionCookieConfig getSessionCookieConfig() { + // TODO SERVLET3 + return null; + } + + + public void setSessionCookieConfig(SessionCookieConfig sessionCookieConfig) { + // TODO SERVLET3 + } + + + public void setSessionTrackingModes( + EnumSet<SessionTrackingMode> sessionTrackingModes) { + // TODO SERVLET3 + } + + /** * Use reflection to invoke the requested method. Cache the method object * to speed up the process Modified: tomcat/trunk/java/org/apache/catalina/core/Constants.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/Constants.java?rev=731967&r1=731966&r2=731967&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/core/Constants.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/Constants.java Tue Jan 6 07:15:32 2009 @@ -22,8 +22,8 @@ public class Constants { public static final String Package = "org.apache.catalina.core"; - public static final int MAJOR_VERSION = 2; - public static final int MINOR_VERSION = 5; + public static final int MAJOR_VERSION = 3; + public static final int MINOR_VERSION = 0; public static final String JSP_SERVLET_CLASS = "org.apache.jasper.servlet.JspServlet"; Modified: tomcat/trunk/java/org/apache/catalina/core/DummyRequest.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/DummyRequest.java?rev=731967&r1=731966&r2=731967&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/core/DummyRequest.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/DummyRequest.java Tue Jan 6 07:15:32 2009 @@ -30,10 +30,14 @@ import java.util.Locale; import java.util.Map; +import javax.servlet.AsyncContext; +import javax.servlet.AsyncListener; import javax.servlet.FilterChain; import javax.servlet.RequestDispatcher; +import javax.servlet.ServletContext; import javax.servlet.ServletInputStream; import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; @@ -263,6 +267,17 @@ public String getLocalName() { return null; } public int getLocalPort() { return -1; } public int getRemotePort() { return -1; } - + public void addAsyncListener(AsyncListener listener, ServletRequest req, + ServletResponse res) {} + public void addAsyncListener(AsyncListener listener) {} + public AsyncContext getAsyncContext() { return null; } + public ServletContext getServletContext() { return null; } + public boolean isAsyncStarted() { return false; } + public boolean isAsyncSupported() { return false; } + public void setAsyncTimeout(long timeout) {} + public AsyncContext startAsync() throws IllegalStateException { + return null; } + public AsyncContext startAsync(ServletRequest req, ServletResponse res) + throws IllegalStateException { return null; } } Modified: tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java?rev=731967&r1=731966&r2=731967&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java (original) +++ tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java Tue Jan 6 07:15:32 2009 @@ -23,16 +23,21 @@ import java.io.PrintWriter; import java.net.MalformedURLException; import java.net.URL; +import java.util.EnumSet; 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.RequestDispatcher; import javax.servlet.Servlet; import javax.servlet.ServletContext; import javax.servlet.ServletException; +import javax.servlet.SessionCookieConfig; +import javax.servlet.SessionTrackingMode; /** @@ -159,7 +164,7 @@ */ public int getMajorVersion() { - return (2); + return (3); } @@ -181,7 +186,7 @@ */ public int getMinorVersion() { - return (3); + return (0); } @@ -437,5 +442,58 @@ } + public void addFilter(String filterName, String description, + String className, Map<String, String> initParameters, + boolean isAsyncSupported) { + // TODO SERVLET3 + } + + + public void addFilterMappingForServletNames(String filterName, + EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, + String... servletNames) { + // TODO SERVLET3 + } + + + public void addFilterMappingForUrlPatterns(String filterName, + EnumSet<DispatcherType> dispatcherTypes, boolean isMatchAfter, + String... urlPatterns) { + // TODO SERVLET3 + } + + + public void addServletMapping(String servletName, String[] urlPatterns) { + // TODO SERVLET3 + } + + + public EnumSet<SessionTrackingMode> getDefaultSessionTrackingModes() { + // TODO SERVLET3 + return null; + } + + + public EnumSet<SessionTrackingMode> getEffectiveSessionTrackingModes() { + // TODO SERVLET3 + return null; + } + + + public SessionCookieConfig getSessionCookieConfig() { + // TODO SERVLET3 + return null; + } + + + public void setSessionCookieConfig(SessionCookieConfig sessionCookieConfig) { + // TODO SERVLET3 + } + + + public void setSessionTrackingModes( + EnumSet<SessionTrackingMode> sessionTrackingModes) { + // TODO SERVLET3 + } } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org