This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is it True???

 
Tualha Khan
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Randall Twede
Ranch Hand
Posts: 4371
3
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh my! And I thought servlet chaining was just one servlet calling another
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic