This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!
  • 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 ...
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Al Hobbs
  • salvin francis

servlet chaining

Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can anyone tell me the exact purpose of using servlet chaining
probably with an example???
Author and all-around good cowpoke
Posts: 13078
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Servlet chaining was a way of passing the response from one servlet to another servlet as part of the request (as I understand it). I think this was never part of the official API, but something added by some vendors.
The latest API 2.3 has "Filters" which provide a formal method of specifying a filter that looks at and may modify a request before sending it on to a servlet, also the same thing on the output end. As it happens, I am just now reading the comments on Filters in the Tomcat 4.0 distribution:
"You can now register Filters in the web.xml file that are the application level analogue to Valves in the Catalina core. Filters have the following general features:
- Filters can be mapped to either URL patterns or particular servlets
- Filters can pre-process and post-process requests and responses
- Filters can wrap the request and/or response objects that are passed on
(so you can do content type transformations, for example)
- Filters can respond to a request and return, instead of passing the request on (for example, you can do authentication challenges at the app level)
Related to this, servlets can now do the same sort of wrapping when they pass arguments to a RequestDispatcher. Previously, you were required to pass the original request and response objects received from the container.
Some uses that occur to me:
Transformation of XML output of a servlet by a filter using a selected XSL transform.

author of:
Posts: 6920
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at .
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in again with a new name which meets the requirements.
    Bookmark Topic Watch Topic
  • New Topic