JSP grammar format

zhaozj2021-02-16  46

JSP syntax explanation

(1) instruction explanation

Page instruction

<% @ PAGE

[Language = "java"]

[import = "package.class, ..."]

[contenttype = "text / html"; charset = "gb3212"]

[session = "true | false"]

[buffer = "none | 8kb | sizekb"]

[Autoflush = "True | False"]

[Isthreadsafe = "True | false"]

[info = "text"]

[ErrorPage = RelativeURL]

[iSerrorPage = "true | false"]

[extends = "package.class"]

%>

Include instruction

<@ @ include file = "filename"> contains a static file

Include action instruction

(1)

(2)

Forward action instruction

(1)

(2)

Usebean directive

GetProperty instruction

SetProperty instruction

Prop_EXPR has the following possible situations:

Property = "*" | Property = "PropertyName" |

Property = "PropertyName" param = "parametername" |

Property = "PropertyName" value = "PropertyValue"

(2) Interior object explanation

JSP's built-in object has the following: Request, Response, Out, Session, PageContext, Application, Config, Page

The main method of the Request object:

1, getParameter (String name) Return String

2, getParameternames () Return Enumeration

3, getParameterValues ​​(String name) Return String []

The main method of OUT object:

1, Out.Print (String Name)

The main method of session object:

1, GetAttribute (String Name) Return Object2, GetAttributeNames () Return ENUMERATION

3, GetCreationTime () Return Long

4, getid () return string

5, getlastaccessedtime () Return long

6, getMaxinactiveInterval () Return Int

7, Removeattribute (String Name) Void

8, SetAttribute (String Name, Java.lang.Object Value) Void

The main method of Application object:

1, GetAttribute (String Name) Return Object

2, GetAttributeNames () Return Enumeration

3, GetInitParameter (String Name)

4, GetServletInfo ()

5, SetAttribute (String Name, Object Object)

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

New Post(0)