jsp九大内置对象(8)
时间:2026-01-20
时间:2026-01-20
me ) ;
取得指定名称的session变量值,不推荐使用。
10. String[] getValueNames() ;
取得所有session变量的名称的集合,不推荐使用。
11. void invalidate() ;
销毁这个session对象。
12. boolean isNew() ;
判断一个session是否由服务器产生,但是客户端并没有使用。
13. void pubValue( String name, Object value ) ;
添加一个session变量,不推荐使用。
14. void removeValue( String name ) ;
移除一个session变量的值,不推荐使用。
15. void setAttribute( String name, String value ) ;
设置指定名称的session属性值。
16. void setMaxInactiveInterval( int interval ) ;
设置session的有效期。
17. void removeAttribute( String name ) ;
移除指定名称的session属性。
⑤ pageContext - javax.servlet.jsp.PageContext
pageContext对象存储本JSP页面相关信息,如属性、内建对象等。
方法:
1. void setAttribute( String name, Object value, int scope ) ;
void setAttribute( String name, Object value ) ;
在指定的共享范围内设置属性。
2. Object getAttribute( String name, int scope ) ;
Object getAttribute( String name ) ;
取得指定共享范围内以name为名字的属性值。
3. Object findAttribute( String name ) ;
按页面、请求、会话和应用程序共享范围搜索已命名的属性。
4. void removeAttribute( String name, int scope ) ;
void removeAttribute( String name ) ;
移除指定名称和共享范围的属性。
5. void forward( String url ) ;
将页面导航到指定的URL。
6. Enumeration getAttributeNamesScope( int scope ) ;
取得指定共享范围内的所有属性名称的集合。
7. int getAttributeScope( String name ) ;
取得指定属性的共享范围。
8. ErrorData getErrorDate() ;
取得页面的errorData对象。
9. Exception getException() ;
取得页面的exception对象。
10. ExpressionEvaluator getExpressionEvaluator() ;
取得页面的expressionEvaluator对象。
11. JspWriter getOut() ;
取得页面的out对象。
12. Object getPage() ;
取得页面的page对象。
13. ServletRequest getRequest() ;
取得页面的request对象。
14. ServletResponse getResponse() ;
取得页面的response对象。
15. ServletConfig getConfig() ;
取得页面的config对象。
16. ServletContext getServletContext() ;
取得页面的servletContext对象。
17. HttpSession getSession() ;
取得页面的session对象。
18. VariableResolver getVariableResolver() ;
取得页面的variableResolver对象。
19. void include( String url, boolean flush ) ;
void include( String url ) ;
包含其他的资源,并指定是否自动刷新。
20. void release() ;
重置pageContext内部状态,释放所有内部引用。
21. void initialize( Servlet servlet, ServletRequest request, Servlet
上一篇:22富饶的西沙群岛
下一篇:土的击实自动计算程序