tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Cryder" <>
Subject Q about RequestDispatcher
Date Wed, 27 Sep 2000 22:40:03 GMT
Hi folks,

My question is this: With the removal of ServletContext.getContext(), it
looks like the only way to dispatch a req to a servlet is to use the
RequestDispatcher interface. Is this correct? If so, here's my problem...

I'm looking for a way to forward requests to servlets which are implemented
as inner classes. There is no way to do this through the RequestDispatcher
interface, because it will not be able to find/instantiate the inner class

Now, I _can_ instantiate the inner classes myself (ie. whenever the parent
servlet that contains them is instantiated) and then just invoke the
service() method on them, but I have a feeling that I should really be going
through the RequestDispatcher.


1. What are the implications of invoking service() directly instead of going
through the RequestDispatcher?

2. What would it take to make it possible for RequestDispatcher to find
inner class instances that implement Servlet?

3. Is ther any mechanism to provide a custom RequestDispatcher which could
find/dispatch to inner classes?

4. Do you have any other suggestions as to how I might be able to invoke
inner classes that implement the Servlet interface?

As to why I'm trying to do this in the first place: I'm experimenting with
an event handling framework, and am trying to see if I can mirror the 1.1
event model used by Swing, where inner classes are used extensively.

Thanks much,
Christian Cryder
Software Engineer, Rocks
Lutris Technologies, Inc.
       "What a great time to be a Geek"
------------------------------------------------ ~

View raw message