社区
Web 开发
帖子详情
who can tell me scope =request,page,session the difference in the javabean.
13030075899
2003-10-17 06:30:58
just as subject.
give me the example is best
thanks
...全文
29
5
打赏
收藏
who can tell me scope =request,page,session the difference in the javabean.
just as subject. give me the example is best thanks
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
chaojinn
2003-11-02
打赏
举报
回复
经典,我算明白了
13030075899
2003-10-26
打赏
举报
回复
i dont know how to add the score to you.
machozhao
2003-10-20
打赏
举报
回复
哥们,给点分!!!
qdubit
2003-10-17
打赏
举报
回复
关注!
machozhao
2003-10-17
打赏
举报
回复
request是指bean一直存放在request.setAttribute中,你可以想想request什么时候消失,相应的bean也就消失了。实际上对于request来说,当一个页面完全返回到Browser时就消失了,但是request和page还有些不同,如果我们进行forward,则request还存在,但page中的bean经过这样一下就没有了!所以page中的bean比request中的bean存在的时间更短。
session则一直存放在HttpSession中,一直到这个Session被主动注销或超期为止,因此scope=session的bean存在时间比request和page都长。
总体来说scope控制的是bean实例的存放位置:
scope=session
Bean bean = new Bean();
Session.setAttribute(beanID, bean);
以后使用时,就直接从Session中恢复这个bean
scope=request
Bean bean = new Bean();
request.setAttribute(beanID, bean);
以后使用时,就直接从request中恢复这个bean,当然如果叶面已经递交到Browser了,request对象就消失了
scope=page
Bean bean = new Bean();
这个实例的作用域只是一个jsp
你仔细看看jsp对应的Java就明白了!!!
JavaWeb实战开发
本课程详细讲解了以下内容: 1.jsp环境搭建及入门、虚拟路径和虚拟主机、JSP执行流程 2.使用Eclipse快速开发JSP、编码问题、JSP页面元素以及
request
对象、使用
request
对象实现注册示例 3.请求方式的编码问题、response、请求转发和重定向、cookie、
session
执行机制、
session
共享问题 4.
session
与cookie问题及application、cookie补充说明及四种范围对象作用域 5.JDBC原理及使用Statement访问数据库、使用JDBC切换数据库以及PreparedStatement的使用、Statement与PreparedStatement的区别 6.JDBC调用存储过程和存储函数、JDBC处理大文本CLOB及二进制BLOB类型数据 7.JSP访问数据库、
JavaBean
(封装数据和封装业务逻辑) 8.MVC模式与Servlet执行流程、Servlet25与Servlet30的使用、ServletAPI详解与源码分析 9.MVC案例、三层架构详解、乱码问题以及三层代码流程解析、完善Service和Dao、完善View、优化用户体验、优化三层(加入接口和DBUtil) 1 0.Web调试及bug修复、分页SQL(Oracle、MySQL、SQLSERVER) 11.分页业务逻辑层和数据访问层Service、Dao、分页表示层Jsp、Servlet 12.文件上传及注意问题、控制文件上传类型和大小、下载、各浏览器下载乱码问题 13.EL表达式语法、点操作符和中括号操作符、EL运算、隐式对象、JSTL基础及set、out、remove 14.过滤器、过滤器通配符、过滤器链、监听器 15.
session
绑定解绑、钝化活化 16.以及Ajax的各种应用 17. Idea环境下的Java Web开发
Java Interview Questions/Java面试题 .
1 What is transient variable? Transient variable can't be serialize. For example if a variable is declared as transient in a Serializable class and the class is written to an Ob...
Thinking in Enterprise Java by Bruce Eckel et. Al.
Introduction to Enterprise ProgrammingHistorically, programming across multiple machines has been error-prone, difficult, and complex.The programmer had to know many details about the network an
Thinking in Enterprise Java
Thinking in EnterpriseJava by Bruce Eckel et. Al.Revision 1.1, 5-06-2003Please note this document isunder development and incomplete. Updates to this document can be found at http://
Java Interview Questions/Java面试题
1 What is transient variable?Transient variable cant be serialize. For example if a variable is declared as transient in a Serializable class and the class is written to an ObjectStrea
Web 开发
81,091
社区成员
341,718
社区内容
发帖
与我相关
我的任务
Web 开发
Java Web 开发
复制链接
扫一扫
分享
社区描述
Java Web 开发
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章