• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is it True???

 
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh my! And I thought servlet chaining was just one servlet calling another
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic