Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 57977 invoked from network); 15 Jun 2000 14:19:03 -0000 Received: from mail-oak-3.pilot.net (HELO mail03-oak.pilot.net) (198.232.147.18) by locus.apache.org with SMTP; 15 Jun 2000 14:19:03 -0000 Received: from mammoth.simpata.com ([206.189.5.194]) by mail03-oak.pilot.net with ESMTP id HAA17201 for ; Thu, 15 Jun 2000 07:19:02 -0700 (PDT) Received: by SHASTA with Internet Mail Service (5.5.2650.21) id ; Thu, 15 Jun 2000 07:19:02 -0700 Message-ID: From: Fedor Karpelevitch To: "'tomcat-user@jakarta.apache.org'" Subject: RE: How to write a html filter using tomcat Date: Thu, 15 Jun 2000 07:19:02 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N I believe, servlet mappings are just for this. To get what you want put something like this in web.xml: ParserServlet mypackage.ParserClass ParserServlet /*.html 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: ParserServlet /*.htm good luck. > -----Original Message----- > From: Gabriel Russell [mailto:g.russell@ieee.org] > Sent: Thursday, June 15, 2000 6:42 AM > To: tomcat-user@jakarta.apache.org > Subject: How to write a html filter using tomcat > > > I'm a little confused as to the scope of writing a html filter. > > Suppose that I want to write a piece of Java that for every > html page get > served the code would filter through the html for any foreign > links and > replace the link with a click through counter. > > I'd have no trouble writing the code. I just can't think of > how to get the > code to run. If I wanted to write it in c then I could simply > create a > apache response-handler. Is there a way to write > response-handlers with > tomcat? It seams like I should be able to say: for any > request matching > /foo/*.html send that request to /servlets/Parser. Parser > would then be > able to look in the request object and figure out what file was being > requested, open it, parse it, then dump it out. Does this make sense? > > Thanks for tuning in > Gabriel Russell > g.russell@ieee.org > > > -------------------------------------------------------------- > ------------ > To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org > For additional commmands, email: tomcat-user-help@jakarta.apache.org >