Elements in the JSP page
I. Release: Three annotations, will print to the client, and the remaining two are ignored by the JSP engine.
Second, template element: refers to the static HTLM or XML content in the JSP, which affects the structure of the page and theesthetics, but that is a business, it is unrelated to programmers.
Third, scripting elements: including declaration, expression (Expression), and scriptlets, in addition to some minor differences, ScriptleTs can replace the first two functions.
Fourth, instruction elements:
The JSP instruction is a message sent by the JSP to the JSP package container. They are used to set the full game, such as class declarations, the way to implement, and output content types, etc., and do not generate any output to the customer. It only affects this JSP file.
1. AGE instruction: Used to define and operate the properties of many important pages, these properties communicate with the JSP package container. Anywhere in JSP, in any order, one page can contain any number of PAGE instructions. However, in addition to the Import instruction, other instructions can only appear once. Several important PAGE instructions:
<% @ Page import = "java.io. *, Java.util. *"%> // Import package
<% @ Buffer = ""%> // Defines the buffer model for the customer output stream.
<% @ Info = ""%> // You can use servlet.getServletInfo () to get this string
<% @ IserrorPage = ""%>
<% @ Errorpage = ""%>
<% @ ISthreadsafe = ""%> // can use multiple threaded use
2, include instructions: there are a lot of ASP, and later introduce.
3, Taglib Directive: For details, please refer to the author Previous article "Custom Tag in Struts".
Five, action elements
The JSP action element is written in XML syntax, which is a response to the JSP runtime, and the response is sent to the customer in the requesting phase. They should be provided by all bag containers regardless of their implementation.
From the effect, a standard action is a tag that can be embedded in the JSP page. During the page is compiled as a servlet, when the package container encounters this tag, it is replaced with the Java code corresponding to the requesting predefined task.
1,
It is used with
2,
If included is a static file, 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 executed by the JSP compilation equipment.
Theoretical <% @ Page Include = ""%> Differences with
Here is sample code for this mark:
<% @ Page ContentType = "text / html; charset = GB2312" Language = "java"%>
<% @ include file = "static.html"%>
<% // just put the files in%>
This Examples show include Works
jsp: incrude>
body>
html>
ßthis is static.html>