Implicit Objects for Scriptlets

 (JSP Scriplets中的隐含对象)

Type

 (对应类型)

Scope

 (范围)

 Some Useful Methods (see class or interface for others)

 (常用的方法)

1

request

Subclass of javax.servlet.ServletRequest

Request

getAttribute, getParameter, getParameterNames, getParameterValues, setAttribute

2

response

Subclass of javax.servlet.ServletResponse

Page

Not typically used by JSP page authors

3

pageContext

javax.servlet.jsp.PageContext

Page

findAttribute, getAttribute, getAttributesScope, getAttributeNamesInScope, setAttribute

4

session

javax.servlet.http.HttpSession

Session

getAttribute, getId, setAttribute

5

application

javax.servlet.ServletContext

Application

getAttribute, getMimeType, getRealPath, setAttribute

6

out

javax.servlet.jsp.JspWriter

Page

clear, clearBuffer, flush, getBufferSize, getRemaining

7

config

javax.servlet.ServletConfig

Page

getInitParameter, getInitParameterNames

8

page

java.lang.Object

Page

Not typically used by JSP page authors

9

exception

java.lang.Throwable

Page

getMessage, getLocalizedMessage, printStackTrace, toString