社区
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
...全文
24
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就明白了!!!
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
SEAM IN ACTION有空就翻翻
说实话,关于SEAM的书不多。在网上搜seam in action中文版,有,在csdn,花3分下下来,假的。是中文的参考文档(Seam reference)。找骂。自己也真想细致地了解一下SEAM的前世今生,所以试着自己翻一下...
Web 开发
81,090
社区成员
341,731
社区内容
发帖
与我相关
我的任务
Web 开发
Java Web 开发
复制链接
扫一扫
分享
社区描述
Java Web 开发
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章