You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@apache.org on 2001/05/26 19:45:19 UTC
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core BaseInterceptor.java Container.java
costin 01/05/26 10:45:19
Modified: src/share/org/apache/tomcat/core BaseInterceptor.java
Container.java
Log:
Added postReadRequest hook, will be used to decode the request and
do additional pre-processing ( session id extraction, etc ) - same as in
the apache's hook with the same name.
Revision Changes Path
1.46 +16 -0 jakarta-tomcat/src/share/org/apache/tomcat/core/BaseInterceptor.java
Index: BaseInterceptor.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/BaseInterceptor.java,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- BaseInterceptor.java 2001/03/09 23:47:39 1.45
+++ BaseInterceptor.java 2001/05/26 17:45:18 1.46
@@ -108,6 +108,21 @@
}
// -------------------- Request notifications --------------------
+
+ /**
+ * Called immediately after the request has been received, before
+ * any mapping.
+ *
+ * This allows modules to alter the request before it is mapped, and
+ * implement decoding/encoding, detect charsets, etc.
+ * The request URI and (some) headers will be available.
+ *
+ * Similar with Apache's post_read_request
+ */
+ public int postReadRequest(Request request ) {
+ return 0;
+ }
+
/** Handle mappings inside a context.
* You are required to respect the mappings in web.xml.
@@ -115,6 +130,7 @@
public int requestMap(Request request ) {
return 0;
}
+
/** Will detect the context path for a request.
* It need to set: context, contextPath, lookupPath
*
1.50 +19 -17 jakarta-tomcat/src/share/org/apache/tomcat/core/Container.java
Index: Container.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/Container.java,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- Container.java 2001/03/08 03:51:26 1.49
+++ Container.java 2001/05/26 17:45:18 1.50
@@ -388,29 +388,31 @@
// -------------------- Interceptors --------------------
- public static final int H_requestMap=0;
- public static final int H_contextMap=1;
- public static final int H_authenticate=2;
- public static final int H_authorize=3;
- public static final int H_preService=4;
- public static final int H_beforeBody=5;
- public static final int H_findSession=6;
- public static final int H_sessionState=7;
- public static final int H_beforeCommit=8;
- public static final int H_afterBody=9;
- public static final int H_postService=10;
- public static final int H_postRequest=11;
- public static final int H_handleError=12;
- public static final int H_getInfo=13;
- public static final int H_setInfo=14;
- public static final int H_engineInit=15;
- public static final int H_COUNT=16;
+ public static final int H_postReadRequest=0;
+ public static final int H_requestMap=1;
+ public static final int H_contextMap=2;
+ public static final int H_authenticate=3;
+ public static final int H_authorize=4;
+ public static final int H_preService=5;
+ public static final int H_beforeBody=6;
+ public static final int H_findSession=7;
+ public static final int H_sessionState=8;
+ public static final int H_beforeCommit=9;
+ public static final int H_afterBody=10;
+ public static final int H_postService=11;
+ public static final int H_postRequest=12;
+ public static final int H_handleError=13;
+ public static final int H_getInfo=14;
+ public static final int H_setInfo=15;
+ public static final int H_engineInit=16;
+ public static final int H_COUNT=17;
Hooks hooks=new Hooks();
BaseInterceptor hooksCache[][]=null;
BaseInterceptor allHooksCache[]=null;
private void initHooks() {
+ hooks.registerHook( "postReadRequest", H_postReadRequest );
hooks.registerHook( "requestMap", H_requestMap );
hooks.registerHook( "contextMap", H_contextMap );
hooks.registerHook( "authenticate", H_authenticate );