HTML comment
Display a comment on the client.
JSP syntax
] ->
Example 1
Generate and the same data as above in the client's HTML source code:
Example 2
->
Displayed in the client's HTML source code:
description
This annotation is very similar to HTML, that is, it can be seen in "View Source Code".
The only difference is that you can use expressions in this comment. This expression is unclear, different from the page, you can use a variety of expressions, as long as it is legal. More please see the expression
JSP syntax
<% - comment -%>
example:
<% @ Page language = "java"%>
<% - this Comment Will Not Be Visible in The Page Source -%>
body>
html>
description
The characters with hidden comments marked will be ignored when JSP compiles. This comment is useful when you want to hide or annotate your JSP program. The JSP compiler does not compile the statement between <% - and -%>, which does not display in the customer's browser, and will not see in the source code.
Between <% - -%> You can write an comment statement, but you can't use "-%>" if you do not use "-% />".
statement
Declaring the legal variables and methods in the JSP program
JSP syntax
<%! Declaration; [Declaration;] ...%>
example
<%! Int = 0;%>
<%! Int A, B, C;%>
<%! Circle a = new circle (2.0);%>
description
Declare that variables and methods you will be used in the JSP program. You must do this, or you will be wrong.
You can declare multiple variables and methods in one time, as long as ";" is ending, of course, these statements are legal in Java.
Please pay attention to some of the following rules when you declare methods or variables:
The statement must be ";"; "Scriptlet has the same rule, but the expression is different).
You can use the declared variables and methods that have been included in <% @ Page%>, do not need to be re-declared.
A statement is only valid in one page. If you want each page to use some statements, it is best to write them into a separate file, then use <% @ include%> or