Re: R: R: Error : request.getReader()

2007-01-30 Thread Craig McClanahan

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



Re: R: R: Error : request.getReader()

2007-01-30 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Marcello,

Marcello Savino 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).

HTTP requests should not contain any HTML at all, so I'm not sure what
you were expecting to read from the request.

I'm starting to think that Dave Newton was on the right track, although
it seemed like a hideous hack ;)

So, correct me if I'm wrong, but it sounds like you want to put some
server-side checks /outside/ your HTML-generating code in order to
perform some quality-assurance on the outgoing HTML code.

I think this is best done with a filter.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFv4B89CaO5/Lv0PARAm0DAKDD/MaKU+ZhVKsK7hziU8nSRVHSmQCgmrsQ
vElcEzZcruaNNlTifc9gOqI=
=b4U+
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: R: R: Error : request.getReader()

2007-01-30 Thread Dave Newton
From: Christopher Schultz
 I'm starting to think that Dave Newton was on the right track,
 although it seemed like a hideous hack ;)

Pretty much any time I'm on the right track it's a hideous hack. I start
off meaning well then it all goes cow's legs up.

 I think this is best done with a filter.

+1 to Chris and Craig.

Dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]