Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doubt about commets

 
Ayub ali khan
Ranch Hand
Posts: 394
2
  • Mark post as helpful
  • send pies
  • 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 ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64967
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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: 394
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply. I appreciate your inputs
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic