tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harish <>
Subject Bug in the Impl of Interceptor architecture?
Date Tue, 21 Mar 2000 06:34:13 GMT
Hi costin,

	I wrote a test interceptor which just checks if all the methods of the
Interface are being called.Added the following entry in server.xml:
"<RequestInterceptor className="MyInterceptor" />"
(after all the Request Interceptors present). 

	[I've attached the code and the output below.]

	The results say that only
contextMap(),requestMap(),authorize(),beforeBody() are being called.
Other methods like: preService(), postService() aren't getting called at
 	Isn't that a bug?
	I tried accessing the admin context apart from the ROOT and got the
same results.

Also, the AdminContext isn't adding the contexts on the fly. I'm going
through the source of tomcat. I know that i'm getting the error from the
"DefaultErrorPage" servlet, but am not able to find out who's causing it
as request.getAttribute(tomcat.servlet.error.throwable) is NULL(and so i
cant do a printStackTrace()). This is the case with servlets. Regarding
Jsps it tries to fetch the page from "c:\program files\apache
group\jakarta-tomcat\" directory.

I need to figure out the problem with the hot deployment of SERVLETS
soon as i can. Please help me as to how to fix this problem with


import org.apache.tomcat.core.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.rmi.*;
import com.pramati.util.*;

public class MyInterceptor extends BaseInterceptor{
    public int contextMap(Request request){
		System.out.println("contextMap() called! class="+ request.getClass());
		return 0;
    public int requestMap(Request request){
		System.out.println("requestMap() called!");
		return 0;
    public int authenticate(Request request, Response response)
		return 0;
    public int authorize(Request request, Response response){
		System.out.println("authorize() called!");
		return 0;
    public int preService(Request request, Response response){
		System.out.println("preService() called!");
		return 0;
    public int beforeBody( Request request, Response response){
		System.out.println("beforeBody() called!");
		return 0;
    public int beforeCommit( Request request, Response response){
		System.out.println("beforeCommit() called!");
		return 0;
    public int afterBody( Request request, Response response){
		System.out.println("afterBody() called!");
		return 0;
    public int postService(Request request, Response response){
		System.out.println("postService() called!");
		return 0;
    public String[] getMethods(){
		System.out.println("getMethods() called!");
		return new String[0];



output:(for each request sent to tomcat)

contextMap() called! class=class
requestMap() called!
authorize() called!
contextMap() called! class=class org.apache.tomcat.core.RequestImpl
requestMap() called!
contextMap() called! class=class
requestMap() called!
beforeBody() called!

View raw message