Check the TLD for this tag. You are interested in the <body-content> element. If the value is 'JSP' then the comments should not appear. However if it is 'tagdependent' then the comments will not be stripped out unless the tag does it explicitly.
Ben -----Original Message----- From: Tom Halliley [mailto:[EMAIL PROTECTED] Sent: 08 July 2003 14:54 To: Tomcat Users List Subject: Re: Comments and Tomcat 4 More testing shows that the problem is not in Tomcat/Jasper, but rather in Velocity. We're using the VelocityTag add-on, which is somehow causing JSP comments to be passed through to the generated page. The problem is only reproduced when I add: <%@ taglib uri="/WEB-INF/veltag.tld" prefix="vel" %> <vel:velocity> <html> <head><title><%-- hello --%> hi </title></head> <body <%-- in body--%>> Hi </body> </html> </vel:velocity> to your original example. Thanks, Tom Tim Funk wrote: > What happens if you create a JSP with my snippet below? Which version > of tomcat? Can you paste a jsp which reproduces the problem. I cannot > reproduce this issue with 4.0.4 or 4.1.24. > > -Tim > > Tom Halliley wrote: > >> Yup ... it's being compiled as a JSP. There are no wacky typos. I >> understand that such a comment should not be sent through to the >> generated page at all ... this is precisely the problem. As I stated, >> this behavior changed between Tomcat 3.x and 4.1. >> >> Tom >> >> Tim Funk wrote: >> >>> Hmmm ... Anything in <%-- --%> should not be sent to the browser at >>> all. >>> >>> Are you sure: >>> - That the page is being compiled/executed as a JSP? >>> - That your page contains the correct <%-- --%> and you don't have a >>> wacky typo? >>> - Which tomcat version >>> >>> Can you reproduce with the following case: >>> <html> >>> <head><title><%-- hello --%> hi </title></head> >>> <body <%-- in body--%>> >>> Hi >>> </body> >>> </html> >>> ========= >>> This should yield: >>> <html> >>> <head><title> hi </title></head> >>> <body > >>> Hi >>> </body> >>> </html> >>> >>> >>> -Tim >>> >>> Tom Halliley wrote: >>> >>>> I'm running into the following problem. >>>> >>>> If a JSP page contains, for example, >>>> >>>> <td class=foo <%-- This is a comment --%> width=100> >>>> >>>> then the comment is passed through to the generated HTML page, >>>> causing the browser to end the td tag at the end of the comment, >>>> ignore the width specification, and render the remaining portion of >>>> the td tag as plain text. >>>> >>>> This seems to be a change from Tomcat 3.x. Is Jasper intentionally >>>> sending this form of comment through to the generated page, or is >>>> this a bug? >>>> >>>> Thanks, >>>> Tom >>>> >>> >>> >>> >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [EMAIL PROTECTED] >>> For additional commands, e-mail: [EMAIL PROTECTED] >>> >>> >>> >> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- ------------------------------------------------------------------------ Tom Halliley <mailto:[EMAIL PROTECTED]> WorkForce Software 734.542.4100 x223 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
