File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "doubt about commets" Watch "doubt about commets" New topic

doubt about commets

Ayub ali khan
Ranch Hand

Joined: Oct 20, 2005
Posts: 394
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)


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

Joined: Jan 10, 2002
Posts: 63548

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

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

Joined: Oct 20, 2005
Posts: 394
Thanks for your reply. I appreciate your inputs
I agree. Here's the link:
subject: doubt about commets
It's not a secret anymore!