by Dinesh Thakur Category: JSP Elements

JSP comment

Used for commenting JSP tags base code (or JSP code) of JSP program. A JSP page compiler recognizes JSP comments. As JSP comments are visible in source, code of  JSP program and not visible in any other process of JSP program execution so these are called hidden comments. They are written like this:

<%--……..-->

HTML Comments

Used for commenting html code and text of JSP program. Html interceptor recognizes this type of comments. We use html comment on scripting JSP tags (scriptlet, declaration and expression) but we cannot use these comments on other JSP tags. They are written like this:

<!-- ……………..-->Script comments

Java compiler recognizes this type of comments.

//:-used for commenting one line of code

/*....* /: -used for commenting multiple line of code

                                        Visibility Chart of JSP Comments

Comments

In JSP

program

Source code of java equivalent Servlet

Compiled of java equivalent Servlet

Html code that comes to browser

Output

JSP comments

Yes

-

-

-

-

Html

Yes

Yes

Yes

Yes

-

Java comments

Yes

Yes

-

-

-

 





About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.