JSP --- Learning Notes (5) Core Technology - Grammar Detailed

zhaozj2021-02-16  68

Reference Number "JSP Application Development Detailed" Second Edition

JSP constituent elements: instruction elements, action elements, template elements, scripting elements, declarations, expressions, scriptlets, and built-in objects. Simple, continue.

Note in a JSP:

1 HTML / XML Note:

2 Hide Note: <% - Content -%> <% - Content -%>

Two template elements: actually referring to the front desk, static HTML code, not explained.

Three script elements: declaration, expression (Expression), ScriptleTs

1 Statement: Variables and methods of statement, examples:

<% string getdate () {return new java.util.date (). tolocalestring ();} int count = 10;%>

<%!

String getdate ()

{

Return new java.util.date (). tolocalestring ();

}

INT count = 10;

%>

2 Expression: It is the same as <% = expression%> <% = expression%>.

3 ScriptleTs: is the same as "% scripTlets%> <% scriptlets%>.

Four command elements:

1 Page Directive: Page

2 incrude

3 taglib

Five Action Directive: Dongdong who only works when sending a request. include:

Wait

Ok, I have a roughly understanding of the so-called elements, how do they use it, then you have to decompose.

It is 1 point to sleep, so sleepy! Huhuhu ,,,,,,

Instruction element

It seems that progress is a bit slow, I will work hard!

1 Page instruction: Used to define global properties in the JSP file.

Page instruction properties

Property Description Default Example Language Definition Used Language JavalaANuage = "Java" Import Introduction Other Class Improving Import = "Java.io. *" SESSION Specifies whether the HTTP session is involved in TRESESSION = "True" Buffer Cashier Cash mode is not 8kbuffer = "64KB" AutoFlash Buffer Auto Refresh TRUEAUTOFLASH = "True" Info page information, defined string can be ignored by servlet.getServlet.info () to ignore info = "a new Web" ISERRORPAGE Show an exception page FalseiserrorPage = "false" errorpage The page that is called when defining an exception is ignoring errorpage = "error.jsp" isthreadsafe uses multithreaded trueisthreadsafe = "true" ContentType definition character encoding and page response MIME TYPE = text / html charset = ISO8859-1 Type = "text / html Charset = GB2312 "PageEncodingJSP page Character code PageEncoding = ISO8859-1PageEncoding =" GB2312 "ISELIGNORED Custom EL ignore ISELIGNORED =" True "By chart, I think everyone is more clear.

2 INCLUDE instruction: The resources that can be parsed in JSP can be parsed. (Resolution occurs during the compilation process)

For example: <% @ include file = "Head.jsp"%>

3 Taglib Directive: Use a custom label.

Ok, the instruction element we have learned, I still write it is very easy to understand!

转载请注明原文地址:https://www.9cbs.com/read-15979.html

New Post(0)