> Can I write a servlet that transparently extract specific information
> from HTML pages before they are sent to the browser?
> By transparency I mean that nothing must be changed in html pages
> of an already running Web site?
> In addition how the already written servlets can be maintained without
> changes but doing their normal job?
>
Hi
Servlet engines usually provide a mechanism called chaining whereby you can
direct the output of one servlet through another servlet (ad infinitum). A
classic
example of this would be when you have generated a set of search results and
you
want to highlight the keywords that are in the documents produced. Servlet A
generates
the search results, passes them to Servlet B (along with a list of the
keywords searched for)
which then highlights them in some way.
You can do the same thing, passing output from any servlet to any other
servlet (in this case,
your servlet doesn't make any changes, just gathers information from the
pages).
For the transparency you desire to work you would need to have a Java Web
Server type of
web server where normal html files are served using a file servlet. You can
direct the output of the
file servlet to your data collector servlet and then serve the browser
request.
For non servlet based web servers that have servlet engines running behind
them, for example
IIS 4 on Windows NT, you could try telling the web server that all html
files should be handled
by the servlet engine, tell the servlet engine that all html files are to be
handled by the file servlet
and chain the output of the file servlet to your data collector.
At least that is how things can work in theory. I am just going on what the
documentation tells
me is possible. How it would work in practice is another matter entirely.
Hope that helps
Andy Bailey
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html