[opencms-dev] newbie: parse & modify generated page

Christian Steinert christian_steinert at web.de
Mon Aug 14 12:51:40 CEST 2006


Gerhard Erich Bruckner schrieb:
> hi there!
> 
> does anyone know of an elegant way of parsing and modifying the 
> already-generated DOM of an HTTP-response (for a certain project) before 
> returning the result to the browser?
> 
> from my understanding, that can only be done in the somewhere close
> to the main servlet. (the controller in MVC terms)
> 
> any ideas? (for version 5)
> 
> thx!
> 

Hi,

maybe I am ignorant about this, but I don't know that the response will
ever be parsed into DOM.

The response of a Servlet could even be sth. binary like a GIF image or
it could be plain text. So I don't think, that the response would or
could ever be parsed into an XML or SGML tree.

As for implementing some sort of filter that post-processes everything
again - I don't know how easily you can do that. I think it would be
difficult to do inside of opencms, because only opencms itself will
assemble the pages and then hand them out.

So maybe you can use something that filters the response as a whole with
the downside of course that then you are outside of your
opencms-environment for this task.

Mod_rewrite for apache might be worth a look. Maybe there are different
mechanisms inside a servlet container as well, but I don't know them.

c.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3269 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060814/88217ee3/attachment.bin>


More information about the opencms-dev mailing list