tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc B├Ąchinger <m...@bcwin.ch>
Subject Re: ajax response from tomcat by including JSP from a servlet - fails silently when HTML is badly formed.
Date Sun, 04 Jun 2006 11:22:08 GMT
Am Sonntag, 4. Juni 2006 12.08 schrieb Mladen Adamovic:
> Andrew Braae wrote:
> > However if the JSP that produces the HTML content produces anything less
> > than perfectly-formed HTML, then the response fails - worse still, it
> > fails
> > silently, with no output to the tomcat log files.
>
> You can generate malformed HTML from JSP pages and it is OK, so I assume
> your problem is in rico or ajax related stuff. I think your problem is
> on the client side - client doesn't know to handle imperfectly formed
> HTML in ajax response.
> I had JSP which had errors and warnings  in HTML validator  :) But no
> problem in Tomcat with that :).

Thats my experience too. Tomcat sends the malformed response even if the 
contentType is text/xml. I'm very ok with this behaviour; TC should not parse 
the output by default.

This may confuse at the client side. Eg. Firefox does write a warning to the 
javascript console if the xmlResponse is malformed, but no error is thrown. 
The response will be available as text but not as parsed dom object. A 
JavaScript programmer not aware of this may think there is no response at 
all.

To be aware of malformed xml on the tomcat side a servletfilter could be 
configured which parses the response and reports error to the log (the filter 
could be removed after developing phases). Another approach with xml taglibs 
would help avoiding such validation issues too:

Don't know what recent JSTL does offer. Third party taglib from Google eg.: 
http://www.devsphere.com/xml/taglib/output/examples.html

marc

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message