页面对象总结
来源:互联网 发布:c语言中二维数组 编辑:程序博客网 时间:2024/06/11 00:04
八大对象:Application session request page response config pageContent
一、如果在jsp页面内:
八大对象随便用,不需要获取:
<%
application,session,request,page,pageContext,response,config,out;
%>
在转化为servlet时,里面有内置对象:
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
pageContext =_jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();//基本上都是通过PageContent沟通的;
二、在Action里面:
可以通过ServletActionContent类获取application request responsesession等
HttpServletRequestrequest=ServletActionContext.getRequest();
HttpServletResponseresponse=ServletActionContext.getResponse();
ServletContextapplication=ServletActionContext.getServletContext();
HttpSessionsession=request.getSession();
三、在servlet里面可以获取所有对象,类似于jsp编译成servlet:
PageContext context =JspFactory.getDefaultFactory().getPageContext(this, request, response, null,true, 8*1024, true);(servlet里面的方法,其他的可以借鉴第一条)
总结:
ServletActionContext和pageContext他们两个都是获取其他一部分对象的中介;
- 页面对象总结
- Jsp页面传递对象问题总结
- javaWEB总结(12):JSP页面的九个隐含对象
- 关于页面跳转的一些总结 浏览器对象与页面刷新 -- JAVA web
- 页面总结
- 页面使用struts2标签获取List中的对象属性值,Struts2常用标签总结
- Ehcache学习总结(3)--Ehcache 整合Spring 使用页面、对象缓存
- 在js代码拼接dom对象到页面上去的模板总结
- 对象总结
- DHTML 页面对象属性
- Ajax 页面对象创建
- dojo 查找页面对象
- javascript-----页面对象
- js页面对象控制
- jsp 页面传对象
- dwr页面传递对象
- 页面对象的定位
- 页面打印总结
- 如何使用TCP向远端SERVER传输数据 (发送与接收)
- c++ string类实现
- 【转】Java Web开发中路径问题小结
- CHotKey热键的使用
- Android应用开发揭秘的第6个程序5_1_ViewDrawRect修改版和高仿版的源码注释
- 页面对象总结
- 由M构成的正立的等腰三角形
- HTML中Smarty中的if语句条件修饰词eq相等ne、neq不相等,gt大于,lt小于
- 用委托实现子窗体与父窗体间的传值
- Web_submit_form和Web_submit_data的区别
- Delphi中TFrame组件的使用
- Oracle数据库 求百分比排名
- JPG压缩算法
- findstr "{" *.rb