The JSTL tag is used today. When redirecting a tag, I encountered a very bad problem, that is, when I test the tag, I want to test other content, because it is redirected (the browser address will change), it will certainly affect my subsequent tests, so I want to comment out this line of code:
Then I tested the other content, but the problem was that every time I refresh the browser, I still redirected it. I wondered, isn't this sentence a comment? Why did I still execute the statement, and then I deleted the sentence. At this time, I knew whether the comment was useful, And then I checked the information online, this annotation is useless for Jsp. It is the original html/xml annotation and should be used.<% -- -- %>This annotation is enough, and then I think about it again. The original notes in Java: // and/**/can also be commented out as follows:<% //-- -- %>,What is the difference between this and the above two types? At this time, the execution process of jsp may be required. Here we will simply say that every jsp page will be translated into servlet by the jsp Engine. java, the specific content can be found in the Project in the work folder under the tomcat directory, so the last comment is a thorough comment, because it is in servlet. java is commented out, and the previous two annotations are in servlet. java code is not commented out. below is the servlet. java code snippet:
Note the following with <% //... %>:
Out. write ("--> \ r \ n ");
Out. write ("
\ R \ n ");
Out. write ("\ r \ n ");
Out. write (" \ R \ n ");
Out. write ("");
//
Here we can see that this sentence is directly commented out, namely:Content in Jsp <%... %> will be translated into servlet. java intact
Annotated with <% ---- %>:
Out. write ("--> \ r \ n ");
Out. write ("
\ R \ n ");
Out. write ("\ r \ n ");
Out. write (" \ R \ n ");
Out. write ("");
Use Note:
Out. write ("--> \ r \ n ");
Out. write ("
\ R \ n ");
Out. write ("\ r \ n ");
Out. write (" \ R \ n ");
Out. write (" The comment has no effect!
Summary:
1. First comment:
This is the original HTML/XML comment, which will be honestly sent to the client. If there is anything you can't see, use it.
2. The second annotation:
<% -- Comment content -- %>
The content <%> is written to the JSP application server and will not be sent to the client. The compiler ignores it, and html does not meet with it, and the app server is no longer involved. This annotation seems redundant, and I don't know what to do with another such annotation.
3. Comment 3:
<%
// When the line comment
/**
Multi-line comment
*/
%>