GeeCON Prague 2014*
The moose likes JSP and the fly likes doubt about commets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "doubt about commets" Watch "doubt about commets" New topic
Author

doubt about commets

Ayub ali khan
Ranch Hand

Joined: Oct 20, 2005
Posts: 380
    
    2
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 ]

SCEA part I,TOGAF Foundation
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61315
    
  66

HTML comments are just template text and will become part of the response.
[ November 09, 2005: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ayub ali khan
Ranch Hand

Joined: Oct 20, 2005
Posts: 380
    
    2
Thanks for your reply. I appreciate your inputs
 
GeeCON Prague 2014
 
subject: doubt about commets