Author: remy.maucherat(a)jboss.com
Date: 2010-04-30 19:47:43 -0400 (Fri, 30 Apr 2010)
New Revision: 1458
Modified:
trunk/java/org/apache/catalina/Globals.java
trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java
trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
trunk/java/org/apache/catalina/connector/Request.java
trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java
trunk/java/org/apache/catalina/core/ApplicationRequest.java
trunk/java/org/apache/catalina/core/StandardContextValve.java
trunk/java/org/apache/catalina/core/StandardHostValve.java
trunk/java/org/apache/catalina/core/StandardWrapperValve.java
trunk/java/org/apache/catalina/servlets/CGIServlet.java
trunk/java/org/apache/catalina/servlets/DefaultServlet.java
trunk/java/org/apache/catalina/servlets/WebdavServlet.java
trunk/java/org/apache/catalina/valves/ErrorReportValve.java
trunk/java/org/jboss/web/php/Handler.java
trunk/java/org/jboss/web/php/ScriptEnvironment.java
Log:
- Remove constants that are now useless.
Modified: trunk/java/org/apache/catalina/Globals.java
===================================================================
--- trunk/java/org/apache/catalina/Globals.java 2010-04-30 23:46:34 UTC (rev 1457)
+++ trunk/java/org/apache/catalina/Globals.java 2010-04-30 23:47:43 UTC (rev 1458)
@@ -53,13 +53,6 @@
/**
- * The servlet context attribute under which we store the class loader
- * used for loading servlets (as an object of type java.lang.ClassLoader).
- */
- public static final String CLASS_LOADER_ATTR =
- "org.apache.catalina.classloader";
-
- /**
* Request dispatcher state.
*/
public static final String DISPATCHER_TYPE_ATTR =
@@ -80,56 +73,6 @@
/**
- * The servlet context attribute under which we store the class path
- * for our application class loader (as an object of type String),
- * delimited with the appropriate path delimiter for this platform.
- */
- public static final String CLASS_PATH_ATTR =
- "org.apache.catalina.jsp_classpath";
-
-
- /**
- * 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 the Invoker servlet will store
- * the invoking servlet path, if it was used to execute a servlet
- * indirectly instead of through a servlet mapping.
- */
- public static final String INVOKED_ATTR =
- "org.apache.catalina.INVOKED";
-
-
- /**
* The request attribute under which we expose the value of the
* <code><jsp-file></code> value associated with this
servlet,
* if any.
@@ -188,14 +131,6 @@
/**
- * The servlet context attribute under which the MBeanServer will be stored
- * for privileged contexts (if enabled).
- */
- public static final String MBEAN_SERVER_ATTR =
- "org.apache.catalina.MBeanServer";
-
-
- /**
* The request attribute under which we store the servlet name on a
* named dispatcher request.
*/
@@ -204,94 +139,6 @@
/**
- * 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 name of the cookie used to pass the session identifier back
* and forth with the client.
*/
@@ -319,14 +166,6 @@
/**
- * 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: trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java
===================================================================
--- trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java 2010-04-30
23:46:34 UTC (rev 1457)
+++ trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java 2010-04-30
23:47:43 UTC (rev 1458)
@@ -31,7 +31,6 @@
import javax.servlet.http.HttpServletRequest;
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;
@@ -319,7 +318,7 @@
} catch (Throwable 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);
}
@@ -346,7 +345,7 @@
} catch (Throwable 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: trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
===================================================================
--- trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 2010-04-30 23:46:34 UTC
(rev 1457)
+++ trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 2010-04-30 23:47:43 UTC
(rev 1458)
@@ -50,6 +50,7 @@
import javax.servlet.AsyncEvent;
import javax.servlet.AsyncListener;
+import javax.servlet.RequestDispatcher;
import javax.servlet.SessionTrackingMode;
import org.apache.catalina.Context;
@@ -270,7 +271,7 @@
// Calling the container
connector.getContainer().getPipeline().getFirst().event(request,
response, request.getEvent());
- if (!error && (request.getAttribute(Globals.EXCEPTION_ATTR) !=
null)) {
+ if (!error &&
(request.getAttribute(RequestDispatcher.ERROR_EXCEPTION) != null)) {
// An unexpected exception occurred while processing the event, so
// error should be called
request.getEvent().setType(HttpEvent.EventType.ERROR);
Modified: trunk/java/org/apache/catalina/connector/Request.java
===================================================================
--- trunk/java/org/apache/catalina/connector/Request.java 2010-04-30 23:46:34 UTC (rev
1457)
+++ trunk/java/org/apache/catalina/connector/Request.java 2010-04-30 23:47:43 UTC (rev
1458)
@@ -1440,7 +1440,7 @@
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();
@@ -1548,7 +1548,7 @@
} catch (Throwable t) {
context.getLogger().error(sm.getString("coyoteRequest.attributeEvent"), t);
// Error valve will pick this execption up and display it to user
- attributes.put( Globals.EXCEPTION_ATTR, t );
+ attributes.put(RequestDispatcher.ERROR_EXCEPTION, t);
}
}
}
@@ -1632,7 +1632,7 @@
} catch (Throwable t) {
context.getLogger().error(sm.getString("coyoteRequest.attributeEvent"), t);
// Error valve will pick this execption up and display it to user
- attributes.put( Globals.EXCEPTION_ATTR, t );
+ attributes.put(RequestDispatcher.ERROR_EXCEPTION, t);
}
}
}
Modified: trunk/java/org/apache/catalina/core/ApplicationDispatcher.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationDispatcher.java 2010-04-30 23:46:34 UTC
(rev 1457)
+++ trunk/java/org/apache/catalina/core/ApplicationDispatcher.java 2010-04-30 23:47:43 UTC
(rev 1458)
@@ -454,16 +454,16 @@
(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());
}
@@ -614,19 +614,19 @@
(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);
}
@@ -932,7 +932,7 @@
HttpServletRequest houterRequest =
(HttpServletRequest) state.outerRequest;
Object contextPath = houterRequest.getAttribute
- (Globals.INCLUDE_CONTEXT_PATH_ATTR);
+ (RequestDispatcher.INCLUDE_CONTEXT_PATH);
if (contextPath == null) {
// Forward
contextPath = houterRequest.getContextPath();
Modified: trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java 2010-04-30 23:46:34
UTC (rev 1457)
+++ trunk/java/org/apache/catalina/core/ApplicationHttpRequest.java 2010-04-30 23:47:43
UTC (rev 1458)
@@ -70,14 +70,14 @@
* 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,
- AsyncContext.ASYNC_REQUEST_URI, AsyncContext.ASYNC_CONTEXT_PATH,
- AsyncContext.ASYNC_SERVLET_PATH, AsyncContext.ASYNC_PATH_INFO,
- AsyncContext.ASYNC_QUERY_STRING };
+ { 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,
+ AsyncContext.ASYNC_REQUEST_URI, AsyncContext.ASYNC_CONTEXT_PATH,
+ AsyncContext.ASYNC_SERVLET_PATH, AsyncContext.ASYNC_PATH_INFO,
+ AsyncContext.ASYNC_QUERY_STRING };
/**
@@ -325,7 +325,7 @@
// 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: trunk/java/org/apache/catalina/core/ApplicationRequest.java
===================================================================
--- trunk/java/org/apache/catalina/core/ApplicationRequest.java 2010-04-30 23:46:34 UTC
(rev 1457)
+++ trunk/java/org/apache/catalina/core/ApplicationRequest.java 2010-04-30 23:47:43 UTC
(rev 1458)
@@ -22,10 +22,11 @@
import java.util.Enumeration;
import java.util.HashMap;
+import javax.servlet.AsyncContext;
+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.catalina.util.StringManager;
@@ -56,11 +57,14 @@
* 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,
+ AsyncContext.ASYNC_REQUEST_URI, AsyncContext.ASYNC_CONTEXT_PATH,
+ AsyncContext.ASYNC_SERVLET_PATH, AsyncContext.ASYNC_PATH_INFO,
+ AsyncContext.ASYNC_QUERY_STRING };
// ----------------------------------------------------------- Constructors
Modified: trunk/java/org/apache/catalina/core/StandardContextValve.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardContextValve.java 2010-04-30 23:46:34 UTC
(rev 1457)
+++ trunk/java/org/apache/catalina/core/StandardContextValve.java 2010-04-30 23:47:43 UTC
(rev 1458)
@@ -21,6 +21,7 @@
import java.io.IOException;
+import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletRequestEvent;
@@ -28,7 +29,6 @@
import javax.servlet.http.HttpServletResponse;
import org.apache.catalina.Container;
-import org.apache.catalina.Globals;
import org.apache.catalina.Wrapper;
import org.apache.catalina.connector.Request;
import org.apache.catalina.connector.Response;
@@ -182,7 +182,7 @@
container.getLogger().error(sm.getString("standardContext.requestListener.requestInit",
instances[i].getClass().getName()), t);
ServletRequest sreq = request.getRequest();
- sreq.setAttribute(Globals.EXCEPTION_ATTR,t);
+ sreq.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
return;
}
}
@@ -206,7 +206,7 @@
container.getLogger().error(sm.getString("standardContext.requestListener.requestDestroy",
instances[i].getClass().getName()), t);
ServletRequest sreq = request.getRequest();
- sreq.setAttribute(Globals.EXCEPTION_ATTR,t);
+ sreq.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
}
}
}
@@ -249,7 +249,7 @@
container.getLogger().error(sm.getString("requestListenerValve.requestInit",
instances[i].getClass().getName()), t);
ServletRequest sreq = request.getRequest();
- sreq.setAttribute(Globals.EXCEPTION_ATTR,t);
+ sreq.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
return;
}
}
@@ -274,7 +274,7 @@
container.getLogger().error(sm.getString("requestListenerValve.requestDestroy",
instances[i].getClass().getName()), t);
ServletRequest sreq = request.getRequest();
- sreq.setAttribute(Globals.EXCEPTION_ATTR,t);
+ sreq.setAttribute(RequestDispatcher.ERROR_EXCEPTION, t);
}
}
}
Modified: trunk/java/org/apache/catalina/core/StandardHostValve.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardHostValve.java 2010-04-30 23:46:34 UTC
(rev 1457)
+++ trunk/java/org/apache/catalina/core/StandardHostValve.java 2010-04-30 23:47:43 UTC
(rev 1458)
@@ -135,7 +135,7 @@
// 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);
@@ -187,7 +187,7 @@
response.setSuspended(false);
if (request.getAsyncContext() == null) {
- Throwable t = (Throwable) request.getAttribute(Globals.EXCEPTION_ATTR);
+ Throwable t = (Throwable)
request.getAttribute(RequestDispatcher.ERROR_EXCEPTION);
if (t != null) {
throwable(request, response, t);
} else {
@@ -197,7 +197,7 @@
Request.AsyncContextImpl asyncContext = (Request.AsyncContextImpl)
request.getAsyncContext();
if ((event.getType() == EventType.TIMEOUT || event.getType() ==
EventType.ERROR)
&& request.isEventMode() && asyncContext.getPath() ==
null) {
- Throwable t = (Throwable) request.getAttribute(Globals.EXCEPTION_ATTR);
+ Throwable t = (Throwable)
request.getAttribute(RequestDispatcher.ERROR_EXCEPTION);
if (t != null) {
throwable(request, response, t);
} else {
@@ -268,19 +268,19 @@
request.setAttribute(ApplicationFilterFactory.DISPATCHER_TYPE_ATTR,
ApplicationFilterFactory.ERROR_INTEGER);
request.setAttribute
- (Globals.STATUS_CODE_ATTR,
+ (RequestDispatcher.ERROR_STATUS_CODE,
Integer.valueOf(HttpServletResponse.SC_INTERNAL_SERVER_ERROR));
- request.setAttribute(Globals.ERROR_MESSAGE_ATTR,
+ 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 {
@@ -334,13 +334,13 @@
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());
@@ -350,9 +350,9 @@
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: trunk/java/org/apache/catalina/core/StandardWrapperValve.java
===================================================================
--- trunk/java/org/apache/catalina/core/StandardWrapperValve.java 2010-04-30 23:46:34 UTC
(rev 1457)
+++ trunk/java/org/apache/catalina/core/StandardWrapperValve.java 2010-04-30 23:47:43 UTC
(rev 1458)
@@ -55,6 +55,7 @@
import javax.servlet.AsyncContext;
import javax.servlet.AsyncEvent;
import javax.servlet.AsyncListener;
+import javax.servlet.RequestDispatcher;
import javax.servlet.Servlet;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@@ -639,7 +640,7 @@
asyncListenerRegistration.getRequest(),
asyncListenerRegistration.getResponse());
asyncListener.onTimeout(asyncEvent);
} else if (error) {
- Throwable t = (Throwable)
request.getAttribute(Globals.EXCEPTION_ATTR);
+ Throwable t = (Throwable)
request.getAttribute(RequestDispatcher.ERROR_EXCEPTION);
AsyncEvent asyncEvent = new AsyncEvent(asyncContext,
asyncListenerRegistration.getRequest(),
asyncListenerRegistration.getResponse(), t);
asyncListener.onError(asyncEvent);
@@ -716,7 +717,7 @@
*/
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: trunk/java/org/apache/catalina/servlets/CGIServlet.java
===================================================================
--- trunk/java/org/apache/catalina/servlets/CGIServlet.java 2010-04-30 23:46:34 UTC (rev
1457)
+++ trunk/java/org/apache/catalina/servlets/CGIServlet.java 2010-04-30 23:47:43 UTC (rev
1458)
@@ -36,6 +36,7 @@
import java.util.StringTokenizer;
import java.util.Vector;
+import javax.servlet.RequestDispatcher;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@@ -47,7 +48,6 @@
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
-import org.apache.catalina.Globals;
import org.apache.catalina.util.IOTools;
@@ -560,11 +560,6 @@
protected void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
- // Verify that we were not accessed using the invoker servlet
- if (req.getAttribute(Globals.INVOKED_ATTR) != null)
- throw new UnavailableException
- ("Cannot invoke CGIServlet through the invoker");
-
CGIEnvironment cgiEnv = new CGIEnvironment(req, getServletContext());
if (cgiEnv.isValid()) {
@@ -733,16 +728,16 @@
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();
@@ -764,7 +759,7 @@
String qs;
if (isIncluded) {
qs = (String) req.getAttribute(
- Globals.INCLUDE_QUERY_STRING_ATTR);
+ RequestDispatcher.INCLUDE_QUERY_STRING);
} else {
qs = req.getQueryString();
}
Modified: trunk/java/org/apache/catalina/servlets/DefaultServlet.java
===================================================================
--- trunk/java/org/apache/catalina/servlets/DefaultServlet.java 2010-04-30 23:46:34 UTC
(rev 1457)
+++ trunk/java/org/apache/catalina/servlets/DefaultServlet.java 2010-04-30 23:47:43 UTC
(rev 1458)
@@ -43,6 +43,7 @@
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;
@@ -300,12 +301,12 @@
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 = (String) request.getAttribute(
- Globals.INCLUDE_SERVLET_PATH_ATTR);
+ RequestDispatcher.INCLUDE_SERVLET_PATH);
if ((result == null) || (result.equals("")))
result = "/";
return (result);
@@ -644,7 +645,7 @@
// 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 {
@@ -667,7 +668,7 @@
// 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();
}
@@ -683,7 +684,7 @@
// Checking If headers
boolean included =
- (request.getAttribute(Globals.INCLUDE_CONTEXT_PATH_ATTR) != null);
+ (request.getAttribute(RequestDispatcher.INCLUDE_CONTEXT_PATH) != null);
if (!included
&& !checkIfHeaders(request, response, cacheEntry.attributes)) {
return;
Modified: trunk/java/org/apache/catalina/servlets/WebdavServlet.java
===================================================================
--- trunk/java/org/apache/catalina/servlets/WebdavServlet.java 2010-04-30 23:46:34 UTC
(rev 1457)
+++ trunk/java/org/apache/catalina/servlets/WebdavServlet.java 2010-04-30 23:47:43 UTC
(rev 1458)
@@ -38,6 +38,7 @@
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;
@@ -47,7 +48,6 @@
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;
@@ -375,9 +375,9 @@
*/
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: trunk/java/org/apache/catalina/valves/ErrorReportValve.java
===================================================================
--- trunk/java/org/apache/catalina/valves/ErrorReportValve.java 2010-04-30 23:46:34 UTC
(rev 1457)
+++ trunk/java/org/apache/catalina/valves/ErrorReportValve.java 2010-04-30 23:47:43 UTC
(rev 1458)
@@ -22,10 +22,10 @@
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;
@@ -102,7 +102,7 @@
getNext().invoke(request, response);
Throwable throwable =
- (Throwable) request.getAttribute(Globals.EXCEPTION_ATTR);
+ (Throwable) request.getAttribute(RequestDispatcher.ERROR_EXCEPTION);
if (response.isCommitted()) {
return;
Modified: trunk/java/org/jboss/web/php/Handler.java
===================================================================
--- trunk/java/org/jboss/web/php/Handler.java 2010-04-30 23:46:34 UTC (rev 1457)
+++ trunk/java/org/jboss/web/php/Handler.java 2010-04-30 23:47:43 UTC (rev 1458)
@@ -184,11 +184,6 @@
throws ServletException, IOException
{
- // Verify that we were not accessed using the invoker servlet
- if (req.getAttribute(Globals.INVOKED_ATTR) != null)
- throw new UnavailableException
- ("Cannot invoke PHP Gateway Handler through the invoker");
-
ScriptEnvironment env = new ScriptEnvironment(req,
getServletContext(),
scriptPathPrefix);
Modified: trunk/java/org/jboss/web/php/ScriptEnvironment.java
===================================================================
--- trunk/java/org/jboss/web/php/ScriptEnvironment.java 2010-04-30 23:46:34 UTC (rev
1457)
+++ trunk/java/org/jboss/web/php/ScriptEnvironment.java 2010-04-30 23:47:43 UTC (rev
1458)
@@ -33,10 +33,10 @@
import java.util.StringTokenizer;
import java.util.Vector;
+import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
-import org.apache.catalina.Globals;
import org.apache.catalina.util.IOTools;
import org.jboss.logging.Logger;
@@ -572,11 +572,11 @@
this.tempDir = (File)context.getAttribute(ServletContext.TEMPDIR);
- if (req.getAttribute(Globals.INCLUDE_CONTEXT_PATH_ATTR) != null) {
+ if (req.getAttribute(RequestDispatcher.INCLUDE_CONTEXT_PATH) != null) {
// Include
- this.contextPath = (String)
req.getAttribute(Globals.INCLUDE_CONTEXT_PATH_ATTR);
- this.servletPath = (String)
req.getAttribute(Globals.INCLUDE_SERVLET_PATH_ATTR);
- this.pathInfo = (String) req.getAttribute(Globals.INCLUDE_PATH_INFO_ATTR);
+ this.contextPath = (String)
req.getAttribute(RequestDispatcher.INCLUDE_CONTEXT_PATH);
+ this.servletPath = (String)
req.getAttribute(RequestDispatcher.INCLUDE_SERVLET_PATH);
+ this.pathInfo = (String)
req.getAttribute(RequestDispatcher.INCLUDE_PATH_INFO);
}
else {
// Direct call