Hi,
On Fri, 9 Jul 1999, Stuart Allen wrote:
SA| I have an SSI servlet that needs to know information about the HTML page it
SA| is in (and others beneath it). At the moment I am manually opening these
SA| HTML pages as files, reading them line by line a parsing them for the
SA| required tags. Is there a cleaner system for accessing the content of tag
SA| from within a servlet? Is this a situation where the DOM can be used?

The ApacheJSSI - Package is based on a general PageParserServlet
which allows you to define 'TagHandlers' which can be registered in the
init-function of the Servlet. The one predefined tag which is handled is
the <SERVLET>-Tag (and the <A>, <FRAME>,<AREA> - tag in an URL-rewriting
SSI).

The PageParserServlet parses the page once, creates the TagHandlers and
caches the positon information. In the processing stage of the page, the
'executeTag()' - method of the TagHandlers is called (The <SERVLET>-tag
handler just calles the servlet with the parameters got in the parsing
stage). 
See the Api-Documentation of ApacheJSSI, it contains a simple example how
to implement the TagHandler interface.

The parsing process does _not_ generate a DOM tree or whatever, it is just
plain tag-driven and fast. But if this is sufficient for you, it might be
worth checking it out. What exactly do you want to do ?

ciao,
  -hen
---
Henner Zeller                                 [EMAIL PROTECTED]
 PGP pub key [77F75B39]: finger [EMAIL PROTECTED] 

 If Microsoft is the answer, it must have been a VERY silly question.



------------------------------------------------------------
To subscribe:    [EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:       [EMAIL PROTECTED]

Reply via email to