• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

doubt about commets

 
Ranch Hand
Posts: 399
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could any one pls clarify the out put of the following code?

Given this JSP snippet (Referred HF Servlets and JSP final Mock exam question 8)

<!--X-->
<%=A.b()%>
<!--<%=A.b()%>-->
<%--Y--%>

Assuming A.b() is a valid call and returns test.

The answer for this code is given as <!--X-->test<!--test-->

Aslo pls clarify a scenario where if both html comment and JSP comments are included in the JSP. Are both the comments supressed in the output or will an html comment displayed?

When I executed the JSP with both html and JSP comments on Tomcat 5.0.x. (latest version) neither of the comments were displayed in the output. Am I correct in assuming that none of the comments (html and JSP)will be displayed in the output?

if we consider the following code snippet:

<%-- This is an XML comment -->
<!-- This is a HTML comment --->

Sorry for making the question lengthy

Thanks before hand
[ November 09, 2005: Message edited by: Ayub ali khan ]
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HTML comments are just template text and will become part of the response.
[ November 09, 2005: Message edited by: Bear Bibeault ]
 
Ayub ali khan
Ranch Hand
Posts: 399
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply. I appreciate your inputs
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic