tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1044326 - in /tomcat/trunk/java: javax/servlet/jsp/ org/apache/catalina/ org/apache/catalina/authenticator/ org/apache/catalina/connector/ org/apache/catalina/core/ org/apache/catalina/servlets/ org/apache/catalina/ssi/ org/apache/catalina...
Date Fri, 10 Dec 2010 12:28:21 GMT
Author: markt
Date: Fri Dec 10 12:28:20 2010
New Revision: 1044326

URL: http://svn.apache.org/viewvc?rev=1044326&view=rev
Log:
Avoid duplicate constant definition.
Use Constants defined by the Servlet/JSP specs where appropriate
Use Constants in preference to local Strings

Modified:
    tomcat/trunk/java/javax/servlet/jsp/PageContext.java
    tomcat/trunk/java/org/apache/catalina/Globals.java
    tomcat/trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java
    tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
    tomcat/trunk/java/org/apache/catalina/connector/Request.java
    tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
    tomcat/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java
    tomcat/trunk/java/org/apache/catalina/core/ApplicationRequest.java
    tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
    tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java
    tomcat/trunk/java/org/apache/catalina/core/StandardWrapperValve.java
    tomcat/trunk/java/org/apache/catalina/servlets/CGIServlet.java
    tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java
    tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java
    tomcat/trunk/java/org/apache/catalina/ssi/SSIServletExternalResolver.java
    tomcat/trunk/java/org/apache/catalina/ssi/SSIServletRequestUtil.java
    tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java
    tomcat/trunk/java/org/apache/catalina/valves/SSLValve.java
    tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
    tomcat/trunk/java/org/apache/jasper/Constants.java
    tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
    tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java
    tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java
    tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java
    tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/SSLSupport.java

Modified: tomcat/trunk/java/javax/servlet/jsp/PageContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/javax/servlet/jsp/PageContext.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/javax/servlet/jsp/PageContext.java (original)
+++ tomcat/trunk/java/javax/servlet/jsp/PageContext.java Fri Dec 10 12:28:20 2010
@@ -19,6 +19,7 @@ package javax.servlet.jsp;
 
 import java.io.IOException;
 
+import javax.servlet.RequestDispatcher;
 import javax.servlet.Servlet;
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
@@ -514,17 +515,21 @@ public abstract class PageContext 
         int status = 0;
         
         Integer status_code = (Integer)getRequest().getAttribute( 
-                "javax.servlet.error.status_code");
+                RequestDispatcher.ERROR_STATUS_CODE);
         // Avoid NPE if attribute is not set
         if (status_code != null) {
             status = status_code.intValue();
         }
 
         return new ErrorData( 
-            (Throwable)getRequest().getAttribute( "javax.servlet.error.exception" ),
+            (Throwable)getRequest().getAttribute(
+                    RequestDispatcher.ERROR_EXCEPTION),
             status,
-            (String)getRequest().getAttribute( "javax.servlet.error.request_uri" ),
-            (String)getRequest().getAttribute( "javax.servlet.error.servlet_name" ) );
+            (String)getRequest().getAttribute(
+                    RequestDispatcher.ERROR_REQUEST_URI),
+            (String)getRequest().getAttribute(
+                    RequestDispatcher.ERROR_SERVLET_NAME)
+            );
     }
     
 }

Modified: tomcat/trunk/java/org/apache/catalina/Globals.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/Globals.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/Globals.java (original)
+++ tomcat/trunk/java/org/apache/catalina/Globals.java Fri Dec 10 12:28:20 2010
@@ -86,38 +86,6 @@ public final class Globals {
 
 
     /**
-     * The request attribute under which we forward a Java exception
-     * (as an object of type Throwable) to an error page.
-     */
-    public static final String EXCEPTION_ATTR =
-        "javax.servlet.error.exception";
-
-
-    /**
-     * The request attribute under which we forward the request URI
-     * (as an object of type String) of the page on which an error occurred.
-     */
-    public static final String EXCEPTION_PAGE_ATTR =
-        "javax.servlet.error.request_uri";
-
-
-    /**
-     * The request attribute under which we forward a Java exception type
-     * (as an object of type Class) to an error page.
-     */
-    public static final String EXCEPTION_TYPE_ATTR =
-        "javax.servlet.error.exception_type";
-
-
-    /**
-     * The request attribute under which we forward an HTTP status message
-     * (as an object of type STring) to an error page.
-     */
-    public static final String ERROR_MESSAGE_ATTR =
-        "javax.servlet.error.message";
-
-
-    /**
      * The request attribute under which we store the key size being used for
      * this SSL connection (as an object of type java.lang.Integer).
      */
@@ -166,94 +134,6 @@ public final class Globals {
 
 
     /**
-     * The request attribute under which the request URI of the included
-     * servlet is stored on an included dispatcher request.
-     */
-    public static final String INCLUDE_REQUEST_URI_ATTR =
-        "javax.servlet.include.request_uri";
-
-
-    /**
-     * The request attribute under which the context path of the included
-     * servlet is stored on an included dispatcher request.
-     */
-    public static final String INCLUDE_CONTEXT_PATH_ATTR =
-        "javax.servlet.include.context_path";
-
-
-    /**
-     * The request attribute under which the path info of the included
-     * servlet is stored on an included dispatcher request.
-     */
-    public static final String INCLUDE_PATH_INFO_ATTR =
-        "javax.servlet.include.path_info";
-
-
-    /**
-     * The request attribute under which the servlet path of the included
-     * servlet is stored on an included dispatcher request.
-     */
-    public static final String INCLUDE_SERVLET_PATH_ATTR =
-        "javax.servlet.include.servlet_path";
-
-
-    /**
-     * The request attribute under which the query string of the included
-     * servlet is stored on an included dispatcher request.
-     */
-    public static final String INCLUDE_QUERY_STRING_ATTR =
-        "javax.servlet.include.query_string";
-
-
-    /**
-     * The request attribute under which the original request URI is stored
-     * on an forwarded dispatcher request.
-     */
-    public static final String FORWARD_REQUEST_URI_ATTR =
-        "javax.servlet.forward.request_uri";
-    
-    
-    /**
-     * The request attribute under which the original context path is stored
-     * on an forwarded dispatcher request.
-     */
-    public static final String FORWARD_CONTEXT_PATH_ATTR =
-        "javax.servlet.forward.context_path";
-
-
-    /**
-     * The request attribute under which the original path info is stored
-     * on an forwarded dispatcher request.
-     */
-    public static final String FORWARD_PATH_INFO_ATTR =
-        "javax.servlet.forward.path_info";
-
-
-    /**
-     * The request attribute under which the original servlet path is stored
-     * on an forwarded dispatcher request.
-     */
-    public static final String FORWARD_SERVLET_PATH_ATTR =
-        "javax.servlet.forward.servlet_path";
-
-
-    /**
-     * The request attribute under which the original query string is stored
-     * on an forwarded dispatcher request.
-     */
-    public static final String FORWARD_QUERY_STRING_ATTR =
-        "javax.servlet.forward.query_string";
-
-
-    /**
-     * The request attribute under which we forward a servlet name to
-     * an error page.
-     */
-    public static final String SERVLET_NAME_ATTR =
-        "javax.servlet.error.servlet_name";
-
-    
-    /**
      * The servlet context attribute under which we store a flag used
      * to mark this request as having been processed by the SSIServlet.
      * We do this because of the pathInfo mangling happening when using
@@ -265,14 +145,6 @@ public final class Globals {
 
 
     /**
-     * The request attribute under which we forward an HTTP status code
-     * (as an object of type Integer) to an error page.
-     */
-    public static final String STATUS_CODE_ATTR =
-        "javax.servlet.error.status_code";
-
-
-    /**
      * The subject under which the AccessControlContext is running.
      */
     public static final String SUBJECT_ATTR =

Modified: tomcat/trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java (original)
+++ tomcat/trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java Fri Dec 10 12:28:20 2010
@@ -30,7 +30,6 @@ import javax.servlet.RequestDispatcher;
 import javax.servlet.http.Cookie;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.catalina.Globals;
 import org.apache.catalina.Realm;
 import org.apache.catalina.Session;
 import org.apache.catalina.connector.Request;
@@ -378,7 +377,7 @@ public class FormAuthenticator
             ExceptionUtils.handleThrowable(t);
             String msg = sm.getString("formAuthenticator.forwardLoginFail");
             log.warn(msg, t);
-            request.setAttribute(Globals.EXCEPTION_ATTR, t);
+            request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
             response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                     msg);
         }
@@ -411,7 +410,7 @@ public class FormAuthenticator
             ExceptionUtils.handleThrowable(t);
             String msg = sm.getString("formAuthenticator.forwardErrorFail");
             log.warn(msg, t);
-            request.setAttribute(Globals.EXCEPTION_ATTR, t);
+            request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
             response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                     msg);
         }

Modified: tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java Fri Dec 10 12:28:20 2010
@@ -22,10 +22,10 @@ import java.io.IOException;
 import java.io.UnsupportedEncodingException;
 import java.util.EnumSet;
 
+import javax.servlet.RequestDispatcher;
 import javax.servlet.SessionTrackingMode;
 
 import org.apache.catalina.Context;
-import org.apache.catalina.Globals;
 import org.apache.catalina.Wrapper;
 import org.apache.catalina.comet.CometEvent;
 import org.apache.catalina.core.ApplicationSessionCookieConfig;
@@ -207,7 +207,8 @@ public class CoyoteAdapter implements Ad
             // Calling the container
             connector.getService().getContainer().getPipeline().getFirst().event(request, response, request.getEvent());
 
-            if (!error && !response.isClosed() && (request.getAttribute(Globals.EXCEPTION_ATTR) != null)) {
+            if (!error && !response.isClosed() && (request.getAttribute(
+                    RequestDispatcher.ERROR_EXCEPTION) != null)) {
                 // An unexpected exception occurred while processing the event, so
                 // error should be called
                 request.getEvent().setEventType(CometEvent.EventType.ERROR);
@@ -275,7 +276,7 @@ public class CoyoteAdapter implements Ad
                 success = true;
                 connector.getService().getContainer().getPipeline().getFirst().invoke(request, response);
                 Throwable t = (Throwable) request.getAttribute(
-                        Globals.EXCEPTION_ATTR);
+                        RequestDispatcher.ERROR_EXCEPTION);
                 if (t != null) {
                     asyncConImpl.setErrorState(t);
                 }

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=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/connector/Request.java (original)
+++ tomcat/trunk/java/org/apache/catalina/connector/Request.java Fri Dec 10 12:28:20 2010
@@ -1342,7 +1342,8 @@ public class Request
             return (context.getServletContext().getRequestDispatcher(path));
 
         // Convert a request-relative path to a context-relative one
-        String servletPath = (String) getAttribute(Globals.INCLUDE_SERVLET_PATH_ATTR);
+        String servletPath = (String) getAttribute(
+                RequestDispatcher.INCLUDE_SERVLET_PATH);
         if (servletPath == null)
             servletPath = getServletPath();
 
@@ -1453,7 +1454,7 @@ public class Request
                 ExceptionUtils.handleThrowable(t);
                 context.getLogger().error(sm.getString("coyoteRequest.attributeEvent"), t);
                 // Error valve will pick this exception up and display it to user
-                attributes.put(Globals.EXCEPTION_ATTR, t);
+                attributes.put(RequestDispatcher.ERROR_EXCEPTION, t);
             }
         }
     }
@@ -1540,7 +1541,7 @@ public class Request
                 ExceptionUtils.handleThrowable(t);
                 context.getLogger().error(sm.getString("coyoteRequest.attributeEvent"), t);
                 // Error valve will pick this exception up and display it to user
-                attributes.put( Globals.EXCEPTION_ATTR, t );
+                attributes.put(RequestDispatcher.ERROR_EXCEPTION, t );
             }
         }
     }

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java Fri Dec 10 12:28:20 2010
@@ -376,16 +376,17 @@ final class ApplicationDispatcher
                 (ApplicationHttpRequest) wrapRequest(state);
             String contextPath = context.getPath();
             HttpServletRequest hrequest = state.hrequest;
-            if (hrequest.getAttribute(Globals.FORWARD_REQUEST_URI_ATTR) == null) {
-                wrequest.setAttribute(Globals.FORWARD_REQUEST_URI_ATTR,
+            if (hrequest.getAttribute(
+                    RequestDispatcher.FORWARD_REQUEST_URI) == null) {
+                wrequest.setAttribute(RequestDispatcher.FORWARD_REQUEST_URI,
                                       hrequest.getRequestURI());
-                wrequest.setAttribute(Globals.FORWARD_CONTEXT_PATH_ATTR,
+                wrequest.setAttribute(RequestDispatcher.FORWARD_CONTEXT_PATH,
                                       hrequest.getContextPath());
-                wrequest.setAttribute(Globals.FORWARD_SERVLET_PATH_ATTR,
+                wrequest.setAttribute(RequestDispatcher.FORWARD_SERVLET_PATH,
                                       hrequest.getServletPath());
-                wrequest.setAttribute(Globals.FORWARD_PATH_INFO_ATTR,
+                wrequest.setAttribute(RequestDispatcher.FORWARD_PATH_INFO,
                                       hrequest.getPathInfo());
-                wrequest.setAttribute(Globals.FORWARD_QUERY_STRING_ATTR,
+                wrequest.setAttribute(RequestDispatcher.FORWARD_QUERY_STRING,
                                       hrequest.getQueryString());
             }
  
@@ -555,19 +556,19 @@ final class ApplicationDispatcher
                 (ApplicationHttpRequest) wrapRequest(state);
             String contextPath = context.getPath();
             if (requestURI != null)
-                wrequest.setAttribute(Globals.INCLUDE_REQUEST_URI_ATTR,
+                wrequest.setAttribute(RequestDispatcher.INCLUDE_REQUEST_URI,
                                       requestURI);
             if (contextPath != null)
-                wrequest.setAttribute(Globals.INCLUDE_CONTEXT_PATH_ATTR,
+                wrequest.setAttribute(RequestDispatcher.INCLUDE_CONTEXT_PATH,
                                       contextPath);
             if (servletPath != null)
-                wrequest.setAttribute(Globals.INCLUDE_SERVLET_PATH_ATTR,
+                wrequest.setAttribute(RequestDispatcher.INCLUDE_SERVLET_PATH,
                                       servletPath);
             if (pathInfo != null)
-                wrequest.setAttribute(Globals.INCLUDE_PATH_INFO_ATTR,
+                wrequest.setAttribute(RequestDispatcher.INCLUDE_PATH_INFO,
                                       pathInfo);
             if (queryString != null) {
-                wrequest.setAttribute(Globals.INCLUDE_QUERY_STRING_ATTR,
+                wrequest.setAttribute(RequestDispatcher.INCLUDE_QUERY_STRING,
                                       queryString);
                 wrequest.setQueryParams(queryString);
             }
@@ -866,8 +867,8 @@ final class ApplicationDispatcher
                 (state.outerRequest instanceof HttpServletRequest)) {
                 HttpServletRequest houterRequest = 
                     (HttpServletRequest) state.outerRequest;
-                Object contextPath = houterRequest.getAttribute
-                    (Globals.INCLUDE_CONTEXT_PATH_ATTR);
+                Object contextPath = houterRequest.getAttribute(
+                        RequestDispatcher.INCLUDE_CONTEXT_PATH);
                 if (contextPath == null) {
                     // Forward
                     contextPath = houterRequest.getContextPath();

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java Fri Dec 10 12:28:20 2010
@@ -69,11 +69,16 @@ class ApplicationHttpRequest extends Htt
      * The set of attribute names that are special for request dispatchers.
      */
     protected static final String specials[] =
-    { Globals.INCLUDE_REQUEST_URI_ATTR, Globals.INCLUDE_CONTEXT_PATH_ATTR,
-      Globals.INCLUDE_SERVLET_PATH_ATTR, Globals.INCLUDE_PATH_INFO_ATTR,
-      Globals.INCLUDE_QUERY_STRING_ATTR, Globals.FORWARD_REQUEST_URI_ATTR, 
-      Globals.FORWARD_CONTEXT_PATH_ATTR, Globals.FORWARD_SERVLET_PATH_ATTR, 
-      Globals.FORWARD_PATH_INFO_ATTR, Globals.FORWARD_QUERY_STRING_ATTR };
+    { RequestDispatcher.INCLUDE_REQUEST_URI,
+      RequestDispatcher.INCLUDE_CONTEXT_PATH,
+      RequestDispatcher.INCLUDE_SERVLET_PATH,
+      RequestDispatcher.INCLUDE_PATH_INFO,
+      RequestDispatcher.INCLUDE_QUERY_STRING,
+      RequestDispatcher.FORWARD_REQUEST_URI, 
+      RequestDispatcher.FORWARD_CONTEXT_PATH,
+      RequestDispatcher.FORWARD_SERVLET_PATH, 
+      RequestDispatcher.FORWARD_PATH_INFO,
+      RequestDispatcher.FORWARD_QUERY_STRING };
 
 
     /**
@@ -307,7 +312,7 @@ class ApplicationHttpRequest extends Htt
 
         // Convert a request-relative path to a context-relative one
         String servletPath = 
-            (String) getAttribute(Globals.INCLUDE_SERVLET_PATH_ATTR);
+            (String) getAttribute(RequestDispatcher.INCLUDE_SERVLET_PATH);
         if (servletPath == null)
             servletPath = getServletPath();
 

Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationRequest.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationRequest.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationRequest.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationRequest.java Fri Dec 10 12:28:20 2010
@@ -22,10 +22,10 @@ package org.apache.catalina.core;
 import java.util.Enumeration;
 import java.util.HashMap;
 
+import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletRequestWrapper;
 
-import org.apache.catalina.Globals;
 import org.apache.catalina.util.Enumerator;
 import org.apache.tomcat.util.res.StringManager;
 
@@ -56,11 +56,16 @@ class ApplicationRequest extends Servlet
      * The set of attribute names that are special for request dispatchers.
      */
     protected static final String specials[] =
-    { Globals.INCLUDE_REQUEST_URI_ATTR, Globals.INCLUDE_CONTEXT_PATH_ATTR,
-      Globals.INCLUDE_SERVLET_PATH_ATTR, Globals.INCLUDE_PATH_INFO_ATTR,
-      Globals.INCLUDE_QUERY_STRING_ATTR, Globals.FORWARD_REQUEST_URI_ATTR, 
-      Globals.FORWARD_CONTEXT_PATH_ATTR, Globals.FORWARD_SERVLET_PATH_ATTR, 
-      Globals.FORWARD_PATH_INFO_ATTR, Globals.FORWARD_QUERY_STRING_ATTR };
+    { RequestDispatcher.INCLUDE_REQUEST_URI,
+      RequestDispatcher.INCLUDE_CONTEXT_PATH,
+      RequestDispatcher.INCLUDE_SERVLET_PATH,
+      RequestDispatcher.INCLUDE_PATH_INFO,
+      RequestDispatcher.INCLUDE_QUERY_STRING,
+      RequestDispatcher.FORWARD_REQUEST_URI, 
+      RequestDispatcher.FORWARD_CONTEXT_PATH,
+      RequestDispatcher.FORWARD_SERVLET_PATH, 
+      RequestDispatcher.FORWARD_PATH_INFO,
+      RequestDispatcher.FORWARD_QUERY_STRING };
 
 
     // ----------------------------------------------------------- Constructors

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Fri Dec 10 12:28:20 2010
@@ -51,6 +51,7 @@ import javax.naming.NamingException;
 import javax.naming.directory.DirContext;
 import javax.servlet.DispatcherType;
 import javax.servlet.FilterConfig;
+import javax.servlet.RequestDispatcher;
 import javax.servlet.Servlet;
 import javax.servlet.ServletContainerInitializer;
 import javax.servlet.ServletContext;
@@ -5749,7 +5750,7 @@ public class StandardContext extends Con
                     getLogger().error(sm.getString(
                             "standardContext.requestListener.requestInit",
                             instances[i].getClass().getName()), t);
-                    request.setAttribute(Globals.EXCEPTION_ATTR,t);
+                    request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
                     return false;
                 }
             }
@@ -5787,7 +5788,7 @@ public class StandardContext extends Con
                     getLogger().error(sm.getString(
                             "standardContext.requestListener.requestInit",
                             instances[j].getClass().getName()), t);
-                    request.setAttribute(Globals.EXCEPTION_ATTR,t);
+                    request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
                     return false;
                 }
             }

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java Fri Dec 10 12:28:20 2010
@@ -172,7 +172,8 @@ final class StandardHostValve
         // Error page processing
         response.setSuspended(false);
 
-        Throwable t = (Throwable) request.getAttribute(Globals.EXCEPTION_ATTR);
+        Throwable t = (Throwable) request.getAttribute(
+                RequestDispatcher.ERROR_EXCEPTION);
 
         if (t != null) {
             throwable(request, response, t);
@@ -230,7 +231,8 @@ final class StandardHostValve
         // Error page processing
         response.setSuspended(false);
 
-        Throwable t = (Throwable) request.getAttribute(Globals.EXCEPTION_ATTR);
+        Throwable t = (Throwable) request.getAttribute(
+                RequestDispatcher.ERROR_EXCEPTION);
 
         if (t != null) {
             throwable(request, response, t);
@@ -296,20 +298,19 @@ final class StandardHostValve
                  errorPage.getLocation());
             request.setAttribute(ApplicationFilterFactory.DISPATCHER_TYPE_ATTR,
                               DispatcherType.ERROR);
-            request.setAttribute
-                (Globals.STATUS_CODE_ATTR,
-                 new Integer(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
-            request.setAttribute(Globals.ERROR_MESSAGE_ATTR,
+            request.setAttribute(RequestDispatcher.ERROR_STATUS_CODE,
+                    new Integer(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
+            request.setAttribute(RequestDispatcher.ERROR_MESSAGE,
                               throwable.getMessage());
-            request.setAttribute(Globals.EXCEPTION_ATTR,
+            request.setAttribute(RequestDispatcher.ERROR_EXCEPTION,
                               realError);
             Wrapper wrapper = request.getWrapper();
             if (wrapper != null)
-                request.setAttribute(Globals.SERVLET_NAME_ATTR,
+                request.setAttribute(RequestDispatcher.ERROR_SERVLET_NAME,
                                   wrapper.getName());
-            request.setAttribute(Globals.EXCEPTION_PAGE_ATTR,
+            request.setAttribute(RequestDispatcher.ERROR_REQUEST_URI,
                                  request.getRequestURI());
-            request.setAttribute(Globals.EXCEPTION_TYPE_ATTR,
+            request.setAttribute(RequestDispatcher.ERROR_EXCEPTION_TYPE,
                               realError.getClass());
             if (custom(request, response, errorPage)) {
                 try {
@@ -363,13 +364,13 @@ final class StandardHostValve
         ErrorPage errorPage = context.findErrorPage(statusCode);
         if (errorPage != null) {
             response.setAppCommitted(false);
-            request.setAttribute(Globals.STATUS_CODE_ATTR,
+            request.setAttribute(RequestDispatcher.ERROR_STATUS_CODE,
                               Integer.valueOf(statusCode));
 
             String message = response.getMessage();
             if (message == null)
                 message = "";
-            request.setAttribute(Globals.ERROR_MESSAGE_ATTR, message);
+            request.setAttribute(RequestDispatcher.ERROR_MESSAGE, message);
             request.setAttribute
                 (ApplicationFilterFactory.DISPATCHER_REQUEST_PATH_ATTR,
                  errorPage.getLocation());
@@ -379,9 +380,9 @@ final class StandardHostValve
 
             Wrapper wrapper = request.getWrapper();
             if (wrapper != null)
-                request.setAttribute(Globals.SERVLET_NAME_ATTR,
+                request.setAttribute(RequestDispatcher.ERROR_SERVLET_NAME,
                                   wrapper.getName());
-            request.setAttribute(Globals.EXCEPTION_PAGE_ATTR,
+            request.setAttribute(RequestDispatcher.ERROR_REQUEST_URI,
                                  request.getRequestURI());
             if (custom(request, response, errorPage)) {
                 try {

Modified: tomcat/trunk/java/org/apache/catalina/core/StandardWrapperValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardWrapperValve.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/StandardWrapperValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/StandardWrapperValve.java Fri Dec 10 12:28:20 2010
@@ -22,13 +22,13 @@ package org.apache.catalina.core;
 import java.io.IOException;
 
 import javax.servlet.DispatcherType;
+import javax.servlet.RequestDispatcher;
 import javax.servlet.Servlet;
 import javax.servlet.ServletException;
 import javax.servlet.UnavailableException;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.catalina.Context;
-import org.apache.catalina.Globals;
 import org.apache.catalina.LifecycleException;
 import org.apache.catalina.comet.CometEvent;
 import org.apache.catalina.comet.CometProcessor;
@@ -522,7 +522,7 @@ final class StandardWrapperValve
      */
     private void exception(Request request, Response response,
                            Throwable exception) {
-        request.setAttribute(Globals.EXCEPTION_ATTR, exception);
+        request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, exception);
         response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
 
     }

Modified: tomcat/trunk/java/org/apache/catalina/servlets/CGIServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/servlets/CGIServlet.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/servlets/CGIServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/servlets/CGIServlet.java Fri Dec 10 12:28:20 2010
@@ -36,6 +36,7 @@ import java.util.Locale;
 import java.util.StringTokenizer;
 import java.util.Vector;
 
+import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
@@ -46,7 +47,6 @@ import javax.servlet.http.HttpServletReq
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
-import org.apache.catalina.Globals;
 import org.apache.catalina.util.IOTools;
 
 
@@ -722,16 +722,17 @@ public final class CGIServlet extends Ht
             boolean isIncluded = false;
 
             // Look to see if this request is an include
-            if (req.getAttribute(Globals.INCLUDE_REQUEST_URI_ATTR) != null) {
+            if (req.getAttribute(
+                    RequestDispatcher.INCLUDE_REQUEST_URI) != null) {
                 isIncluded = true;
             }
             if (isIncluded) {
                 this.contextPath = (String) req.getAttribute(
-                        Globals.INCLUDE_CONTEXT_PATH_ATTR);
+                        RequestDispatcher.INCLUDE_CONTEXT_PATH);
                 this.servletPath = (String) req.getAttribute(
-                        Globals.INCLUDE_SERVLET_PATH_ATTR);
+                        RequestDispatcher.INCLUDE_SERVLET_PATH);
                 this.pathInfo = (String) req.getAttribute(
-                        Globals.INCLUDE_PATH_INFO_ATTR);
+                        RequestDispatcher.INCLUDE_PATH_INFO);
             } else {
                 this.contextPath = req.getContextPath();
                 this.servletPath = req.getServletPath();
@@ -753,7 +754,7 @@ public final class CGIServlet extends Ht
                 String qs;
                 if (isIncluded) {
                     qs = (String) req.getAttribute(
-                            Globals.INCLUDE_QUERY_STRING_ATTR);
+                            RequestDispatcher.INCLUDE_QUERY_STRING);
                 } else {
                     qs = req.getQueryString();
                 }

Modified: tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java Fri Dec 10 12:28:20 2010
@@ -43,6 +43,7 @@ import javax.naming.NameClassPair;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.DirContext;
+import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
 import javax.servlet.ServletOutputStream;
@@ -345,15 +346,16 @@ public class DefaultServlet
         // subclasses can change this behaviour.
 
         // Are we being processed by a RequestDispatcher.include()?
-        if (request.getAttribute(Globals.INCLUDE_REQUEST_URI_ATTR) != null) {
+        if (request.getAttribute(
+                RequestDispatcher.INCLUDE_REQUEST_URI) != null) {
             String result = (String) request.getAttribute(
-                                            Globals.INCLUDE_PATH_INFO_ATTR);
+                    RequestDispatcher.INCLUDE_PATH_INFO);
             if (result == null) {
                 result = (String) request.getAttribute(
-                                            Globals.INCLUDE_SERVLET_PATH_ATTR);
+                        RequestDispatcher.INCLUDE_SERVLET_PATH);
             } else {
                 result = (String) request.getAttribute(
-                                  Globals.INCLUDE_SERVLET_PATH_ATTR) + result;
+                        RequestDispatcher.INCLUDE_SERVLET_PATH) + result;
             }
             if ((result == null) || (result.equals(""))) {
                 result = "/";
@@ -759,7 +761,7 @@ public class DefaultServlet
             // Check if we're included so we can return the appropriate 
             // missing resource name in the error
             String requestUri = (String) request.getAttribute(
-                                            Globals.INCLUDE_REQUEST_URI_ATTR);
+                    RequestDispatcher.INCLUDE_REQUEST_URI);
             if (requestUri == null) {
                 requestUri = request.getRequestURI();
             } else {
@@ -782,7 +784,7 @@ public class DefaultServlet
                 // Check if we're included so we can return the appropriate 
                 // missing resource name in the error
                 String requestUri = (String) request.getAttribute(
-                                            Globals.INCLUDE_REQUEST_URI_ATTR);
+                        RequestDispatcher.INCLUDE_REQUEST_URI);
                 if (requestUri == null) {
                     requestUri = request.getRequestURI();
                 }
@@ -800,8 +802,8 @@ public class DefaultServlet
         if (cacheEntry.context == null) {
 
             // Checking If headers
-            boolean included =
-                (request.getAttribute(Globals.INCLUDE_CONTEXT_PATH_ATTR) != null);
+            boolean included = (request.getAttribute(
+                    RequestDispatcher.INCLUDE_CONTEXT_PATH) != null);
             if (!included && !isError &&
                     !checkIfHeaders(request, response, cacheEntry.attributes)) {
                 return;

Modified: tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java (original)
+++ tomcat/trunk/java/org/apache/catalina/servlets/WebdavServlet.java Fri Dec 10 12:28:20 2010
@@ -39,6 +39,7 @@ import javax.naming.NameClassPair;
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
 import javax.naming.directory.DirContext;
+import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
 import javax.servlet.UnavailableException;
@@ -48,7 +49,6 @@ import javax.xml.parsers.DocumentBuilder
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
 
-import org.apache.catalina.Globals;
 import org.apache.catalina.util.DOMWriter;
 import org.apache.catalina.util.MD5Encoder;
 import org.apache.catalina.util.RequestUtil;
@@ -429,9 +429,10 @@ public class WebdavServlet
     @Override
     protected String getRelativePath(HttpServletRequest request) {
         // Are we being processed by a RequestDispatcher.include()?
-        if (request.getAttribute(Globals.INCLUDE_REQUEST_URI_ATTR) != null) {
+        if (request.getAttribute(
+                RequestDispatcher.INCLUDE_REQUEST_URI) != null) {
             String result = (String) request.getAttribute(
-                                            Globals.INCLUDE_PATH_INFO_ATTR);
+                    RequestDispatcher.INCLUDE_PATH_INFO);
             if ((result == null) || (result.equals("")))
                 result = "/";
             return (result);

Modified: tomcat/trunk/java/org/apache/catalina/ssi/SSIServletExternalResolver.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ssi/SSIServletExternalResolver.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ssi/SSIServletExternalResolver.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ssi/SSIServletExternalResolver.java Fri Dec 10 12:28:20 2010
@@ -293,7 +293,7 @@ public class SSIServletExternalResolver 
             else if (nameParts[1].equals("URI")) {
                 // If this is an error page, get the original URI
                 retVal = (String) req.getAttribute(
-                        "javax.servlet.forward.request_uri");
+                        RequestDispatcher.FORWARD_REQUEST_URI);
                 if (retVal == null) retVal=req.getRequestURI();
             }
         } else if (nameParts[0].equals("SCRIPT")) {

Modified: tomcat/trunk/java/org/apache/catalina/ssi/SSIServletRequestUtil.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ssi/SSIServletRequestUtil.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/ssi/SSIServletRequestUtil.java (original)
+++ tomcat/trunk/java/org/apache/catalina/ssi/SSIServletRequestUtil.java Fri Dec 10 12:28:20 2010
@@ -17,6 +17,7 @@
 package org.apache.catalina.ssi;
 
 
+import javax.servlet.RequestDispatcher;
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.catalina.util.RequestUtil;
@@ -31,12 +32,13 @@ public class SSIServletRequestUtil {
      */
     public static String getRelativePath(HttpServletRequest request) {
         // Are we being processed by a RequestDispatcher.include()?
-        if (request.getAttribute("javax.servlet.include.request_uri") != null) {
-            String result = (String)request
-                    .getAttribute("javax.servlet.include.path_info");
+        if (request.getAttribute(
+                RequestDispatcher.INCLUDE_REQUEST_URI) != null) {
+            String result = (String)request.getAttribute(
+                    RequestDispatcher.INCLUDE_PATH_INFO);
             if (result == null)
-                result = (String)request
-                        .getAttribute("javax.servlet.include.servlet_path");
+                result = (String)request.getAttribute(
+                        RequestDispatcher.INCLUDE_SERVLET_PATH);
             if ((result == null) || (result.equals(""))) result = "/";
             return (result);
         }

Modified: tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java Fri Dec 10 12:28:20 2010
@@ -22,10 +22,10 @@ package org.apache.catalina.valves;
 import java.io.IOException;
 import java.io.Writer;
 
+import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletResponse;
 
-import org.apache.catalina.Globals;
 import org.apache.catalina.connector.Request;
 import org.apache.catalina.connector.Response;
 import org.apache.catalina.util.RequestUtil;
@@ -116,7 +116,7 @@ public class ErrorReportValve extends Va
         }
         
         Throwable throwable =
-            (Throwable) request.getAttribute(Globals.EXCEPTION_ATTR);
+            (Throwable) request.getAttribute(RequestDispatcher.ERROR_EXCEPTION);
 
         if (throwable != null) {
 

Modified: tomcat/trunk/java/org/apache/catalina/valves/SSLValve.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/SSLValve.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/valves/SSLValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/SSLValve.java Fri Dec 10 12:28:20 2010
@@ -24,6 +24,7 @@ import java.security.cert.X509Certificat
 
 import javax.servlet.ServletException;
 
+import org.apache.catalina.Globals;
 import org.apache.catalina.connector.Request;
 import org.apache.catalina.connector.Response;
 
@@ -43,8 +44,7 @@ import org.apache.catalina.connector.Res
  * @version $Id$
  */
 
-public class SSLValve
-    extends ValveBase {
+public class SSLValve extends ValveBase {
     
     
     //------------------------------------------------------ Constructor
@@ -87,19 +87,19 @@ public class SSLValve
                 System.out.println("SSLValve failed " + strcerts);
                 System.out.println("SSLValve failed " + e);
             }
-            request.setAttribute("javax.servlet.request.X509Certificate", jsseCerts);
+            request.setAttribute(Globals.CERTIFICATES_ATTR, jsseCerts);
         }
         strcert0 = mygetHeader(request, "ssl_cipher");
         if (strcert0 != null) {
-            request.setAttribute("javax.servlet.request.cipher_suite", strcert0);
+            request.setAttribute(Globals.CIPHER_SUITE_ATTR, strcert0);
         }
         strcert0 = mygetHeader(request, "ssl_session_id");
         if (strcert0 != null) {
-            request.setAttribute("javax.servlet.request.ssl_session", strcert0);
+            request.setAttribute(Globals.SSL_SESSION_ID_ATTR, strcert0);
         }
         strcert0 = mygetHeader(request, "ssl_cipher_usekeysize");
         if (strcert0 != null) {
-            request.setAttribute("javax.servlet.request.key_size", strcert0);
+            request.setAttribute(Globals.KEY_SIZE_ATTR, strcert0);
         }
         getNext().invoke(request, response);
     }

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AbstractAjpProcessor.java Fri Dec 10 12:28:20 2010
@@ -42,6 +42,7 @@ import org.apache.tomcat.util.http.HttpM
 import org.apache.tomcat.util.http.MimeHeaders;
 import org.apache.tomcat.util.net.AbstractEndpoint;
 import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState;
+import org.apache.tomcat.util.net.SSLSupport;
 import org.apache.tomcat.util.res.StringManager;
 
 /**
@@ -301,7 +302,7 @@ public abstract class AbstractAjpProcess
                    getLog().error(sm.getString("ajpprocessor.certs.fail"), e);
                    return;
                }
-               request.setAttribute(AbstractEndpoint.CERTIFICATE_KEY, jsseCerts);
+               request.setAttribute(SSLSupport.CERTIFICATE_KEY, jsseCerts);
            }
 
        } else if (actionCode == ActionCode.REQ_HOST_ATTRIBUTE) {
@@ -558,19 +559,19 @@ public abstract class AbstractAjpProcess
            case Constants.SC_A_SSL_CIPHER :
                request.scheme().setString("https");
                requestHeaderMessage.getBytes(tmpMB);
-               request.setAttribute(AbstractEndpoint.CIPHER_SUITE_KEY,
+               request.setAttribute(SSLSupport.CIPHER_SUITE_KEY,
                                     tmpMB.toString());
                break;
 
            case Constants.SC_A_SSL_SESSION :
                request.scheme().setString("https");
                requestHeaderMessage.getBytes(tmpMB);
-               request.setAttribute(AbstractEndpoint.SESSION_ID_KEY,
+               request.setAttribute(SSLSupport.SESSION_ID_KEY,
                                     tmpMB.toString());
                break;
 
            case Constants.SC_A_SSL_KEY_SIZE :
-               request.setAttribute(AbstractEndpoint.KEY_SIZE_KEY,
+               request.setAttribute(SSLSupport.KEY_SIZE_KEY,
                        Integer.valueOf(requestHeaderMessage.getInt()));
                break;
 

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Fri Dec 10 12:28:20 2010
@@ -45,6 +45,7 @@ import org.apache.tomcat.util.http.MimeH
 import org.apache.tomcat.util.net.AbstractEndpoint;
 import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState;
 import org.apache.tomcat.util.net.AprEndpoint;
+import org.apache.tomcat.util.net.SSLSupport;
 import org.apache.tomcat.util.net.SocketStatus;
 import org.apache.tomcat.util.net.SocketWrapper;
 
@@ -518,7 +519,7 @@ public class Http11AprProcessor extends 
                     // Cipher suite
                     Object sslO = SSLSocket.getInfoS(socketRef, SSL.SSL_INFO_CIPHER);
                     if (sslO != null) {
-                        request.setAttribute(AbstractEndpoint.CIPHER_SUITE_KEY, sslO);
+                        request.setAttribute(SSLSupport.CIPHER_SUITE_KEY, sslO);
                     }
                     // Get client certificate and the certificate chain if present
                     // certLength == -1 indicates an error
@@ -535,17 +536,17 @@ public class Http11AprProcessor extends 
                         }
                     }
                     if (certs != null) {
-                        request.setAttribute(AbstractEndpoint.CERTIFICATE_KEY, certs);
+                        request.setAttribute(SSLSupport.CERTIFICATE_KEY, certs);
                     }
                     // User key size
                     sslO = Integer.valueOf(SSLSocket.getInfoI(socketRef,
                             SSL.SSL_INFO_CIPHER_USEKEYSIZE));
-                    request.setAttribute(AbstractEndpoint.KEY_SIZE_KEY, sslO);
+                    request.setAttribute(SSLSupport.KEY_SIZE_KEY, sslO);
 
                     // SSL session ID
                     sslO = SSLSocket.getInfoS(socketRef, SSL.SSL_INFO_SESSION_ID);
                     if (sslO != null) {
-                        request.setAttribute(AbstractEndpoint.SESSION_ID_KEY, sslO);
+                        request.setAttribute(SSLSupport.SESSION_ID_KEY, sslO);
                     }
                     //TODO provide a hook to enable the SSL session to be
                     // invalidated. Set AprEndpoint.SESSION_MGR req attr
@@ -584,7 +585,7 @@ public class Http11AprProcessor extends 
                             }
                         }
                         if (certs != null) {
-                            request.setAttribute(AbstractEndpoint.CERTIFICATE_KEY, certs);
+                            request.setAttribute(SSLSupport.CERTIFICATE_KEY, certs);
                         }
                     }
                 } catch (Exception e) {

Modified: tomcat/trunk/java/org/apache/jasper/Constants.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/Constants.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/Constants.java (original)
+++ tomcat/trunk/java/org/apache/jasper/Constants.java Fri Dec 10 12:28:20 2010
@@ -120,12 +120,6 @@ public class Constants {
     public static final String TAG_FILE_PACKAGE_NAME = 
         System.getProperty("org.apache.jasper.Constants.TAG_FILE_PACKAGE_NAME", "org.apache.jsp.tag");
 
-    /**
-     * Servlet context and request attributes that the JSP engine
-     * uses. 
-     */
-    public static final String INC_SERVLET_PATH = "javax.servlet.include.servlet_path";
-
     // Must be kept in sync with org/apache/catalina/Globals.java
     public static final String ALT_DD_ATTR = 
         System.getProperty("org.apache.jasper.Constants.ALT_DD_ATTR", "org.apache.catalina.deploy.alt_dd");

Modified: tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/JspRuntimeLibrary.java Fri Dec 10 12:28:20 2010
@@ -55,11 +55,6 @@ import org.apache.jasper.compiler.Locali
  */
 public class JspRuntimeLibrary {
     
-    private static final String SERVLET_EXCEPTION
-        = "javax.servlet.error.exception";
-    private static final String JSP_EXCEPTION
-        = "javax.servlet.jsp.jspException";
-
     protected static class PrivilegedIntrospectHelper
         implements PrivilegedExceptionAction<Void> {
 
@@ -100,9 +95,10 @@ public class JspRuntimeLibrary {
      * variable is initialized.
      */
     public static Throwable getThrowable(ServletRequest request) {
-        Throwable error = (Throwable) request.getAttribute(SERVLET_EXCEPTION);
+        Throwable error = (Throwable) request.getAttribute(
+                RequestDispatcher.ERROR_EXCEPTION);
         if (error == null) {
-            error = (Throwable) request.getAttribute(JSP_EXCEPTION);
+            error = (Throwable) request.getAttribute(PageContext.EXCEPTION);
             if (error != null) {
                 /*
                  * The only place that sets JSP_EXCEPTION is
@@ -111,7 +107,7 @@ public class JspRuntimeLibrary {
                  * ErrorReportValve. Therefore, if JSP_EXCEPTION is set, we
                  * need to set SERVLET_EXCEPTION.
                  */
-                request.setAttribute(SERVLET_EXCEPTION, error);
+                request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, error);
             }
         }
 
@@ -875,11 +871,11 @@ public class JspRuntimeLibrary {
         if (!(request instanceof HttpServletRequest))
             return (relativePath);
         HttpServletRequest hrequest = (HttpServletRequest) request;
-        String uri = (String)
-            request.getAttribute("javax.servlet.include.servlet_path");
+        String uri = (String) request.getAttribute(
+                RequestDispatcher.INCLUDE_SERVLET_PATH);
         if (uri != null) {
             String pathInfo = (String)
-                request.getAttribute("javax.servlet.include.path_info");
+                request.getAttribute(RequestDispatcher.INCLUDE_PATH_INFO);
             if (pathInfo == null) {
                 if (uri.lastIndexOf('/') >= 0) 
                     uri = uri.substring(0, uri.lastIndexOf('/'));

Modified: tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/PageContextImpl.java Fri Dec 10 12:28:20 2010
@@ -29,6 +29,7 @@ import java.util.HashMap;
 import javax.el.ELContext;
 import javax.el.ExpressionFactory;
 import javax.el.ValueExpression;
+import javax.servlet.RequestDispatcher;
 import javax.servlet.Servlet;
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
@@ -47,7 +48,6 @@ import javax.servlet.jsp.el.ExpressionEv
 import javax.servlet.jsp.el.VariableResolver;
 import javax.servlet.jsp.tagext.BodyContent;
 
-import org.apache.jasper.Constants;
 import org.apache.jasper.compiler.Localizer;
 import org.apache.jasper.el.ELContextImpl;
 import org.apache.jasper.el.ExpressionEvaluatorImpl;
@@ -170,7 +170,8 @@ public class PageContextImpl extends Pag
         setAttribute(PAGECONTEXT, this);
         setAttribute(APPLICATION, context);
 
-        isIncluded = request.getAttribute("javax.servlet.include.servlet_path") != null;
+        isIncluded = request.getAttribute(
+                RequestDispatcher.INCLUDE_SERVLET_PATH) != null;
     }
 
     @Override
@@ -638,8 +639,8 @@ public class PageContextImpl extends Pag
         String path = relativeUrlPath;
 
         if (!path.startsWith("/")) {
-            String uri = (String) request
-                    .getAttribute("javax.servlet.include.servlet_path");
+            String uri = (String) request.getAttribute(
+                    RequestDispatcher.INCLUDE_SERVLET_PATH);
             if (uri == null)
                 uri = ((HttpServletRequest) request).getServletPath();
             String baseURI = uri.substring(0, uri.lastIndexOf('/'));
@@ -739,16 +740,17 @@ public class PageContextImpl extends Pag
         }
 
         final String path = getAbsolutePathRelativeToContext(relativeUrlPath);
-        String includeUri = (String) request
-                .getAttribute(Constants.INC_SERVLET_PATH);
+        String includeUri = (String) request.getAttribute(
+                RequestDispatcher.INCLUDE_SERVLET_PATH);
 
         if (includeUri != null)
-            request.removeAttribute(Constants.INC_SERVLET_PATH);
+            request.removeAttribute(RequestDispatcher.INCLUDE_SERVLET_PATH);
         try {
             context.getRequestDispatcher(path).forward(request, response);
         } finally {
             if (includeUri != null)
-                request.setAttribute(Constants.INC_SERVLET_PATH, includeUri);
+                request.setAttribute(RequestDispatcher.INCLUDE_SERVLET_PATH,
+                        includeUri);
         }
     }
 
@@ -858,13 +860,13 @@ public class PageContextImpl extends Pag
              * not been committed (the response will have been committed if the
              * error page is a JSP page).
              */
-            request.setAttribute("javax.servlet.jsp.jspException", t);
-            request.setAttribute("javax.servlet.error.status_code",
+            request.setAttribute(PageContext.EXCEPTION, t);
+            request.setAttribute(RequestDispatcher.ERROR_STATUS_CODE,
                     new Integer(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
-            request.setAttribute("javax.servlet.error.request_uri",
+            request.setAttribute(RequestDispatcher.ERROR_REQUEST_URI,
                     ((HttpServletRequest) request).getRequestURI());
-            request.setAttribute("javax.servlet.error.servlet_name", config
-                    .getServletName());
+            request.setAttribute(RequestDispatcher.ERROR_SERVLET_NAME,
+                    config.getServletName());
             try {
                 forward(errorPageURL);
             } catch (IllegalStateException ise) {
@@ -873,19 +875,19 @@ public class PageContextImpl extends Pag
 
             // The error page could be inside an include.
 
-            Object newException = request
-                    .getAttribute("javax.servlet.error.exception");
+            Object newException =
+                    request.getAttribute(RequestDispatcher.ERROR_EXCEPTION);
 
             // t==null means the attribute was not set.
             if ((newException != null) && (newException == t)) {
-                request.removeAttribute("javax.servlet.error.exception");
+                request.removeAttribute(RequestDispatcher.ERROR_EXCEPTION);
             }
 
             // now clear the error code - to prevent double handling.
-            request.removeAttribute("javax.servlet.error.status_code");
-            request.removeAttribute("javax.servlet.error.request_uri");
-            request.removeAttribute("javax.servlet.error.status_code");
-            request.removeAttribute("javax.servlet.jsp.jspException");
+            request.removeAttribute(RequestDispatcher.ERROR_STATUS_CODE);
+            request.removeAttribute(RequestDispatcher.ERROR_REQUEST_URI);
+            request.removeAttribute(RequestDispatcher.ERROR_SERVLET_NAME);
+            request.removeAttribute(PageContext.EXCEPTION);
 
         } else {
             // Otherwise throw the exception wrapped inside a ServletException.

Modified: tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java (original)
+++ tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java Fri Dec 10 12:28:20 2010
@@ -25,6 +25,7 @@ import java.security.AccessController;
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
 
+import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
@@ -292,7 +293,8 @@ public class JspServlet extends HttpServ
              * Check to see if the requested JSP has been the target of a
              * RequestDispatcher.include()
              */
-            jspUri = (String) request.getAttribute(Constants.INC_SERVLET_PATH);
+            jspUri = (String) request.getAttribute(
+                    RequestDispatcher.INCLUDE_SERVLET_PATH);
             if (jspUri != null) {
                 /*
                  * Requested JSP has been target of
@@ -300,7 +302,7 @@ public class JspServlet extends HttpServ
                  * relevant javax.servlet.include.* request attributes
                  */
                 String pathInfo = (String) request.getAttribute(
-                                    "javax.servlet.include.path_info");
+                        RequestDispatcher.INCLUDE_PATH_INFO);
                 if (pathInfo != null) {
                     jspUri += pathInfo;
                 }
@@ -399,7 +401,7 @@ public class JspServlet extends HttpServ
             throws ServletException, IOException {
 
         String includeRequestUri =
-            (String)request.getAttribute("javax.servlet.include.request_uri");
+            (String)request.getAttribute(RequestDispatcher.INCLUDE_REQUEST_URI);
 
         if (includeRequestUri != null) {
             // This file was included. Throw an exception as

Modified: tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java (original)
+++ tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java Fri Dec 10 12:28:20 2010
@@ -20,6 +20,7 @@ package org.apache.jasper.servlet;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 
+import javax.servlet.RequestDispatcher;
 import javax.servlet.Servlet;
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
@@ -417,7 +418,7 @@ public class JspServletWrapper {
             }
         } catch (UnavailableException ex) {
             String includeRequestUri = (String)
-                request.getAttribute("javax.servlet.include.request_uri");
+                request.getAttribute(RequestDispatcher.INCLUDE_REQUEST_URI);
             if (includeRequestUri != null) {
                 // This file was included. Throw an exception as
                 // a response.sendError() will be ignored by the

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java Fri Dec 10 12:28:20 2010
@@ -49,33 +49,6 @@ public abstract class AbstractEndpoint {
     // -------------------------------------------------------------- Constants
     protected static final StringManager sm = StringManager.getManager("org.apache.tomcat.util.net.res");
 
-    /**
-     * The Request attribute key for the cipher suite.
-     */
-    public static final String CIPHER_SUITE_KEY = "javax.servlet.request.cipher_suite";
-
-    /**
-     * The Request attribute key for the key size.
-     */
-    public static final String KEY_SIZE_KEY = "javax.servlet.request.key_size";
-
-    /**
-     * The Request attribute key for the client certificate chain.
-     */
-    public static final String CERTIFICATE_KEY = "javax.servlet.request.X509Certificate";
-
-    /**
-     * The Request attribute key for the session id.
-     * This one is a Tomcat extension to the Servlet spec.
-     */
-    public static final String SESSION_ID_KEY = "javax.servlet.request.ssl_session";
-
-    /**
-     * The request attribute key for the session manager.
-     * This one is a Tomcat extension to the Servlet spec.
-     */
-    public static final String SESSION_MGR = "javax.servlet.request.ssl_session_mgr";
-
     public static interface Handler {
         /**
          * Different types of socket states to react upon.

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/SSLSupport.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/SSLSupport.java?rev=1044326&r1=1044325&r2=1044326&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/SSLSupport.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/SSLSupport.java Fri Dec 10 12:28:20 2010
@@ -30,7 +30,8 @@ public interface SSLSupport {
     /**
      * The Request attribute key for the cipher suite.
      */
-    public static final String CIPHER_SUITE_KEY = "javax.servlet.request.cipher_suite";
+    public static final String CIPHER_SUITE_KEY =
+            "javax.servlet.request.cipher_suite";
 
     /**
      * The Request attribute key for the key size.
@@ -40,20 +41,22 @@ public interface SSLSupport {
     /**
      * The Request attribute key for the client certificate chain.
      */
-    public static final String CERTIFICATE_KEY = "javax.servlet.request.X509Certificate";
+    public static final String CERTIFICATE_KEY =
+            "javax.servlet.request.X509Certificate";
 
     /**
      * The Request attribute key for the session id.
      * This one is a Tomcat extension to the Servlet spec.
      */
-    public static final String SESSION_ID_KEY = "javax.servlet.request.ssl_session";
+    public static final String SESSION_ID_KEY =
+            "javax.servlet.request.ssl_session";
 
     /**
      * The request attribute key for the session manager.
      * This one is a Tomcat extension to the Servlet spec.
      */
     public static final String SESSION_MGR =
-        "javax.servlet.request.ssl_session_mgr";
+            "javax.servlet.request.ssl_session_mgr";
 
     
     /**



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message