tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacob Hookom" <>
Subject RE: Servlet channing
Date Thu, 16 Jan 2003 20:31:07 GMT
Comments below:

| -----Original Message-----
| From: Reynir Hübner []
| Sent: Thursday, January 16, 2003 2:04 PM
| To: Tomcat Users List
| Subject: RE: Servlet channing
| I can of course only answer this for my self, but the main reason is
| Struts is an implementation of a specific pattern. When I started
| J2EE applications some time ago, struts was not fully grown. I had a
| pattern in my mind that I wanted to have an implementation of. The
| thing in this pattern is the servlet chaining mechanism (btw, filters
| not be introduced (to tomcat or other app servers) when I wrote this
| chaining mechanism).

I'm a big user of Struts and can't say enough about it :-)

| I have to admitt the fact that I have never used struts, and I have
| really spent a lot of time on checking it out.
| The functionality I wanted in my servlet-chains is the ability to
| streamlines, that have can have multiple starting nodes and an
| stop nodes. This means I need to be able to build in some "flow logic"
| into the servlet chain mechanism, I can't see how that would be done
| filters, at least not in the way I want.

Well, Struts acts like a controller to receive requests, then pull data
in from your model (DB, XML, etc), attach it to the request as an
attribute, then pass the request on to another resource to handle the

Filters are great because you can lay them sort of before your
ActionController receives the request.  The reason that I say sort of,
is that Filters act like PullParsers where once your Filter receives the
request, YOU call the next item in the chain by passing the request and
response up the chain.

Here's how I'm using filters with Struts:
I'm using the SecurityFilter to block access to resources on the server
based on user roles.  Then I have a CachingFilter bound to many
resources to cache the output of a Struts Action so I can reduce
processing and catch the request before it re-executes the Struts
Action.  Then I also have TransformationFilters setup so I can convert
the response from an Action into PDF or HTML based on XML outputted by
the succeeding JSP from the Action.

| So I think servlet chaining, struts and filters all describe sepperate
| patterns even though there isn't much difference between them.

Correct, Filters do not replace Struts, but act like an added bonus at
the view level of the MVC framework that Struts provides.

| Each servlet in a chain has some specific purpouse such as determine
| user who is logged on, determine some data that will be used in the
| presentation layer below the chain. If anyone has seen Intershops
| Pipelines my application does similar things, in similar ways except
| propriatary.
| -reynir

Jacob Hookom

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message