One, release: Three kinds of annotation,<!----> will print to the client, the remaining two are ignored by the JSP engine.
Second, the template element: refers to the JSP static HTLM or the XML content, it affects the page structure and the esthetic degree, but that is the art thing, has nothing to do with the programmer.
Third, script elements: including declarations (declaration), Expressions (Expression) and scriptlets, except for some minor differences, scriptlets can completely replace the first two functions.
Four, Directive element:
A JSP instruction is a message that the JSP sends to the JSP package container. They are used to set global values, such as class declarations, methods to implement, output content types, and so on, without producing any output to the client's mouth. It only affects this JSP file.
1, age directive: a property used to define and manipulate many important pages, which communicate with the JSP containment. Anywhere in the JSP, a page can contain any number of page directives in any order. But except for the import directive, other directives can only appear once. Several important page directives:
<% @ buffer= ""%>//defines a buffer model for the customer output stream.
<% @ info= ""%>//can get the string using Servlet.getservletinfo ()
<% @ iserrorpage= ""%>
<% @ errorpage= ""%>
<% @ isthreadsafe= ""%>//jsp file can be used multiple threads
2, include instructions: ASP used a lot of it, and then introduced.
3, taglib directive: see the author's previous article "The Custom tag in struts".
Five, action elements
The JSP action element is written in XML syntax and works in the request processing phase, which affects the behavior of the JSP runtime and the response sent to the customer. They should be provided by all the containment, regardless of their implementation.
In effect, a standard action is a tag that can be embedded into a JSP page. When a page is compiled as a servlet, when the package container encounters the tag, it replaces it with the Java code for the predefined task that is requested.
1,<JSP:PARAM>: Provides additional information for other labels.
It is used in conjunction with <jsp:include>,<jsp:forward>,<jsp:plugin>.
2,<jsp:include>
If the containing is a static file, then just add the content to the JSP file, this file will not be executed by the JSP compiler, if it is a dynamic file, will be the implementation of JSP compiler equipment.
Theoretically <% @ Page include= ""%> differs from <jsp:include>, I call it automatic refresh, but when it comes to a higher version of Tomcat, they function the same.
3,<jsp:forward> is allowed to forward requests to another jsp,servlet, or to a static resource file. This action is especially useful when you want to convert to a different view based on a different request. However, the resource to which the request is diverted must be in the same context as the JSP send request.
4,<jsp:usebean> it to instantiate the JavaBean, or to locate an existing bean instance and assign it to a variable name (or ID). and a specific scope is given to determine the life cycle of the object.
Page: Represents an object associated with a specific request to the page.
Request: Represents an object that is associated with a specific customer request to the page. If a request is sent to another JSP using a <jsp:forward> standard action, or if a <jsp:include> action contains another JSP, the object is valid in the JSP involved.
Session: In the current conversation, the object is valid in any request sent by the same customer.
Application: In the same Web application, the object is valid in any JSP page.
5,<jsp:setproperty> and <jsp:getProperty>
Work with Usebean to set the bean's simple properties and indexed properties, because it's used too often, so let's not say a little bit, you learn in concrete code.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.