my dog learned polymorphism*
The moose likes Servlets and the fly likes Is it True??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Is it True???" Watch "Is it True???" New topic
Author

Is it True???

Tualha Khan
Ranch Hand

Joined: Nov 22, 2000
Posts: 287
Dear All,
Hey,
I have seen the remarks on O' reily's 'Java Servlet Programming'. Some people are of the opinion that the book talks about servlet chaining, which is supported by JWS (server, the author talks about), but is not supported by Apache+Tomcat. Apart from that, they are also of the opinion that servlet chaining is not a good programming practice.
Can anybody shed some light here??
Bye,
Tualha Khan


SCJP2, BEA WLS 6.0, DB2 UDB 7.1
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4340
    
    2

Oh my! And I thought servlet chaining was just one servlet calling another


SCJP
Visit my download page
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Servlet chaining is supported by several servletengines, but the way in which it works is not standardized. The O'Reilly book discusses the mechanism used by JWS as an example.

42
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
Servlet Chaining is a technique where you configure a servlet container to pass the output of one servlet to the input of another (and so on) before returning it to the client. It has several problems.
The first problem is its non-standard implementation. Only a few servlet containers support it, it has never been part of the official servlet API, and cannot be configured using web.xml etc. like other servlet container configurations.
The second problem is that servlets are not essentially chainable. The input to a servlet (a HTTP request and maybe some parameters or POST data) is quite different to the output from a servlet (some formatted HTML ready for display by a browser). So if you are building a system which uses servlet chaining, the servlets have to somehow "know" that they are being used in a chain, and either get their input differently, or produce their output differently, so that communication between the servlets in the chain can make some sort of sense.
When the Servlet 2.3 API is finalized, and the containers which are currently tracking it are released as fully-supporting versions, this whole problem should go away. Version 2.3 of the servlet API brings in the concept of "filters" to do the sort of jobs people want to use servlet chaining for, but as they are not the same as servlets, they can have compatible inputs and outputs, and be plugged together in arbitrary, creative, ways just by reconfiguring a web-application.
You can already try this with the very latest versions of Tomcat, Resin and so on, which have a good stab at implementing the current draft 2.3 API.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is it True???