九大内置对象: out、request、respone、page、pageContext、session、application、exception、config
out
out是javax.servlet.jsp.JspWriter类的实例;
request
request是javax.servlet.ServletRequest类的实例,代表客户端请求;
1 | void setAttribute(String name,Object value) |
response
response是javax.servlet.ServletResponse类的实例,代表客户端请求;1
2
3
4
5
6addCookie(Cookie cookie)
OutputStream getOutputStream()
void sendRedirect(String url)
PrintWriter getOut()
void setHeader(String name,String valuse);
void setStatus(int status)
config
config是javax.servlet.ServletConfig类的实例;1
2
3
4String getInitParameter(String name)
Enumeration getInitParameterNames()
ServletContext getServletContext()
String getServletName()
session
session是javax.servlet.http.HttpSession类的实例;1
2
3
4
5String getId()
Long getCreationTime()
Long getLastAccessedTime()
int getMaxInactiveInterval()
int setMaxInactiveInterval()
application
application是javax.servlet.ServletContext类的实例;
page
page是javax.servlet.jsp.HttpJspPage类的实例;
pageContext
exception
exception是java.lang.Exception类的对象;