You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rama Venkata Kunapuli <em...@hotmail.com> on 2000/11/23 00:46:01 UTC

Servlet chaining in Tomcat

Folks:

I am trying to chain servlets so output of one is directed to next servlet.

Lacking information, I have tried modifying web.xml and made the following 
entries -- ofcourse, it didn't work!

<servlet>
        <servlet-name>ServletChain</servlet-name>
        <servlet-class>SimpleTextServlet,UpperCaseServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>ServletChain</servlet-name>
        <url-pattern>/cha</url-pattern>
    </servlet-mapping>

Output of SimpleTextServlet is supposed to go to UpperCaseServlet.

Any suggestions on how to make this work ?

Thanks,
Rk

_____________________________________________________________________________________
Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com


Re: Servlet chaining in Tomcat

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Rama Venkata Kunapuli wrote:

> Folks:
>
> I am trying to chain servlets so output of one is directed to next servlet.
>
> Lacking information, I have tried modifying web.xml and made the following
> entries -- ofcourse, it didn't work!
>
> <servlet>
>         <servlet-name>ServletChain</servlet-name>
>         <servlet-class>SimpleTextServlet,UpperCaseServlet</servlet-class>
>     </servlet>
>
>     <servlet-mapping>
>         <servlet-name>ServletChain</servlet-name>
>         <url-pattern>/cha</url-pattern>
>     </servlet-mapping>
>
> Output of SimpleTextServlet is supposed to go to UpperCaseServlet.
>
> Any suggestions on how to make this work ?
>

Servlet chaining is not supported by Tomcat, and is quite unlikely to ever be supported.
It is not in the servlet spec, so you will find that many servlet containers don't
support it, and some may support it in different ways.  As a programming technique,
servlet chaining is also fraught with problems.

The recommended approach (from a servlet API perspective) is to use the new Filter
capability that was added in Servlet 2.3 (and implemented in Tomcat 4.0).

>
> Thanks,
> Rk
>

Craig McClanahan