The basic composition of 1.JSP pages
Directive Identity (page,include,taglib) directive: Enables the server to perform actions and set properties that are valid throughout the JSP page range, as set by the directive. <%@ page ....%>
HTML Markup Language: mainly responsible for the layout of the page, design and aesthetics, can be said to be the framework of the page. Embedded Java code fragment: Enables the page to generate dynamic content. <%....%>
JSP expression: The output that is primarily used for data. <%=...%>
2.JSP instruction Identification
There are three main, page directives (page directives), include directives, and taglib directives. <%@ directive Name Attribute 1 = "Property 1" ... %>
The page directive contains a number of useful properties, such as language, ContentType, CharSet, import, Session, IsThreadSafe (whether multithreading requests are used), info (page author information or other information, arbitrary), ErrorPage points to the URL of the error and page, iserrorpage whether to use the exception exception object.
The include directive is used to embed other files in the current JSP page where the instruction is currently used, and to display the results of code execution if there are executable code in the included file.
<%@ include file= "absolute path or relative path of file"%> file does not support any expressions, nor does it support the passing of parameters.
The use format of the taglib directive <% @ taglib uri= "Taguri" prefix= "tagprefic"%> is used to define the tag libraries that need to be used, such as JSTL tags
3.JSP Script Identification
<%java code fragment%> <%= variable name%> <%! Declare the code for a variable or method%>
4.JSP comments
Comments <!--annotation content in HTML--> the annotation content is not visible in the client browser, but can be seen in the viewing HTML source code.
The <!--<%=expression%>--> Server recognizes JSP expressions and performs return results, but does not see the annotation content in the client browser and can be seen in the view of HTML source code.
<%--annotation content--> the client browser and HTML source code are not visible.
Script Comment://For single-line comment,/*....*/for multiline comment,/** hint message ... * * This annotation can be read by the Javadoc Documentation tool when the document is generated.
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.