On 1/29/07, Marcello Savino <[EMAIL PROTECTED]> wrote:

The reason i need the request body is that the action i should take is to
analyze the html generated. (ie.: syntax checking, finding img without alt
attributes, reading meta-information ...).
More: this job must be done server side (no jscript or other client-side
stuff are allowed in my application).
Thanks


Marcello,

To accomplish this goal,  it seems to me you should be caring about the
*response*, not the *request*, right?  After all, it is the response that
contains the markup that was generated by the server.  The request will only
contain the request parameters for this form, in the standard format defined
by the HTML specification.

If my assumption is correct, you should look at technologies that use a
Servlet Filter to be able to capture a copy the rendered output, in addition
to sending it to the browser.  Using a Filter has the advantage of being
something you can add without modifying the actual code that creates the
HTML output, and then removed when you are finished with your testing.  As
to details of the technology, the SiteMesh[1] package has to do exactly what
you are talking about ... buffer up the generated response, and then do
something with it.  SiteMesh is about transforming the generated output,
which you are likely not interested in ... but examining the source code of
the filter that SiteMesh uses should give you a big head start on figuring
out how to implement something like this.

Craig

[1] http://www.opensymphony.com/sitemesh/

Marcello Savino
ALDEBRA S.p.A.
tel.  0461302441

Reply via email to