tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gabriel Russell <g.russ...@ieee.org>
Subject RE: How to write a html filter using tomcat
Date Thu, 15 Jun 2000 14:21:23 GMT
Can you map a single url to more then one servlet? Sort of like the 
stacked-handlers in mod_perl.
It might be nice to have the output of /servlets/Search piped through 
/servlets/Parser before being send to the client.

At 07:19 AM 6/15/2000 -0700, you wrote:
>I believe, servlet mappings are just for this. To get what you want put
>something like this in web.xml:
>
>     <servlet>
>         <servlet-name>ParserServlet</servlet-name>
>         <servlet-class>mypackage.ParserClass</servlet-class>
>     </servlet>
>
>     <servlet-mapping>
>         <servlet-name>ParserServlet</servlet-name>
>         <url-pattern>/*.html</url-pattern>
>     </servlet-mapping>
>
>and mypackage.ParserClass will recieve all the requests for html files. You
>can specify more than one mapping for the same servlet if you need to, for
>instance you can make it handle *.htm as well. To do this add this:
>
>     <servlet-mapping>
>         <servlet-name>ParserServlet</servlet-name>
>         <url-pattern>/*.htm</url-pattern>
>     </servlet-mapping>
>
>good luck.



Mime
View raw message