1. Indicates the element, <%@ indicates the element [attribute = value]*%> which indicates that the element includes page, include, and Tablib three. where property = value can have many pairs. Where page is used to tell the container how to interpret the current JSP page, the following three are the most commonly used page properties: Include is used to include other JSP pages, such as the HTML can be separated from the head and tail, He is then included in various pages through the include indicator element. The JSP is static and is an indicator during compilation. Examples are as follows: subsequently there are <jsp:include xxx> tags, which are dynamic and run-time. by default, a container uses a Servlet object to handle requests from different users, so code written in a JSP must be aware of thread safety issues. 2.affirmsyntax of the element:<%!class member declaration or method declaration%>
As the name implies, the so-called declaration element is used to define a class member variable or method in a JSP file, and the code within the declaration element is generally translated into a member variable or method of the Servlet class. Examples are as follows:
3. The scriptlet element, whose syntax is as follows,
<% Java Statement%>
you can write multiple statements in it, and all statements within <% XXX%> will be translated inside the _jspservice () method.
Scriptlet can be disabled and can be configured in Web. XML, <scripting-invalid>true</scripting-invalid>
It is bad habit to include a lot of scriptlet on the webpage, the good habit is to try El or jstl tag to eliminate scriptlet;
The sample code is as follows:
4. Expression Elements
<%= xxxx%>
The result of the expression operation is directly part of the Web page, such as <%= new Date ()%> 5. Three different types of annotations
the comments of the #,java itself,
#,html notes, <!--xxxx----
#,jsp's notes, <%--xxxxx--%>
#, there are many different types of implicit objects, they can only be used in <% xxx%>, <%= xxxx%>, can no longer <%! xxx%> internal use, because the implicit object is actually the _jspservice method inside the local Variable. #, because <%%> has a special meaning in JSP, if you want to output these two symbols on the HTML interface, you need to use the translation characters
#,<% = <%
#,%>=%>
Learn java--from 0. Introduction to various auxiliary elements from JSP to servlet transformation