request
用戶獲取客戶端的信息
常用方法:
object getAttribute(String name)
void setAttribute(string name坷澡,object value)
String getParameter(String name)等系列
Map? getParameterValues()
void setCharacterEncoding(string encoding)
response
包含了從JSP頁面返回給客戶端的所有信息雾棺,其作用域是它所在的頁面。
常用方法:
void addCookie(Cookie cookie)
void setContentType(String contentType)
void sendRedirect(String URL)? 它與forward動作元素的區(qū)別是? 它可以連接到外網(wǎng)? forward只能是服務器內(nèi)部的地址罚缕。
pageContext
該對象比較特殊,它不僅可以設置當前page范圍的屬性,還可以設置其他范圍內(nèi)的屬性苇倡。也可范圍其他本頁面的其他所有對象。
servletRequest getRequest()
ServletResponse getResponse()
HttpSession getSession()
ServletContext getServletContext()? 獲取application對象
等
session
用來記錄每個客戶端的訪問狀態(tài)
out??
緩沖輸出流
page
指當前頁面本身
aplication
application對象用于獲取和設置servlet的相關信息。它的生命周期是從服務器啟動到服務器停止旨椒。
config
是servletConfig類的一個實例晓褪,在servlet初始化的時候,可以通過config想servlet傳遞信息综慎。