This is odd. I've got a controller built around filters that forwards the
request to the appropriate resource (servlet, JSP page, or whatever). It
works under Catalina. I'm not sure if what I'm doing differs from what
you're saying the Servlet 2.3 spec cannot do, but it sounds to me that they
are the same.
-dan
-----Original Message-----
From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED].
org]On Behalf Of Craig R. McClanahan
Sent: Tuesday, June 12, 2001 3:37 AM
To: [EMAIL PROTECTED]
Subject: RE: Proposal
On Wed, 6 Jun 2001, Dan - Blue Lotus Software wrote:
>
> Of course, the Servlet 2.3 spec hasn't been finalized yet. But Tomcat
> Catalina (in it's 5th beta release) implements Filters. They're really
> cool, and they might make the ActionServlet concept a bit redundant. That
> is, the controller in an MVC/Model 2 architecture can be implemented as a
> Filter.
>
Since I'm in the expert group for Servlet 2.3 (and wrote all the Tomcat 4
code that supports filters), I've thought about this one a lot. And,
truth be told, I'd probably still do the controller as a servlet, even if
I was starting from a 2.3 baseline.
The primary reason for this thinking is that filters cannot "redirect" the
flow of control to different servlets (i.e. different actions in Struts
terminology). The servlet that is going to be executed has already been
selected by the container, based on the original request URI. Given that
you're going to end up executing *some* servlet anyway, you're still faced
with the choice of a single dispatching servlet (which the Struts
controller already does) or implementing each action as a separate servlet
(which, among other things, is quite a lot harder to set up).
> Just my 2p worth.
>
> -dan
Craig McClanahan