One of my classmate asked me, Java has "//" This kind of annotation, easy to use, JSP annotation is not this? "//" is not available in the JSP.
For a JSP that has studied for such a long time, annotations are the most basic. The annotations in the JSP are different from Java.
Two types of annotations are supported in the JSP, one is to display the annotation, the annotation client is allowed to see, and the other is an implicit annotation, which is invisible to the annotation client.
Show comment Syntax: <!--annotation content-->
implicit annotation Syntax:
Format one://comment, single-line annotation;
Format two: * * NOTE * *, multiline annotation;
Format three: <%--annotation--%>,jsp annotation
Implicit annotations It is important to note that there are two annotations that inherit from the Java style, but in this case a new annotation is extended,<%--%>
The following is a program that observes the use of annotations:
<!--This annotation client can see the
annotations in the--> <!--JSP, the client cannot see
the
single-line comment provided in--> <%//java, the client cannot see/
*
Multi-line annotation provided in Java, client cannot see
/
%>
<%--also can't see--%>
Run Result: the page is blank.
Since it is a JSP program, you must have the support of the Web container when you execute it, so you have to start Tomcat, then access Tomcat through the browser, and execute the program.
In fact, the so-called display is still inherited, from the style of HTML language to continue to use the
When the JSP finally executes, it becomes HTML style
This article is from the "Zhao Yuqiang blog" blog, please be sure to keep this source http://zhaoyuqiang.blog.51cto.com/6328846/1111131