所谓scope,是用来指定一个范围:引用这个JavaBean时,如果在这个范围找到了现成的对象,则利用那个现成的对象,如果在这个范围没有找到,则新建一个。
解决方案 »
- 求救???org.hibernate.TransactionException: Transaction not successfully started
- stuuts控制后,验证码不能显示!!
- 新手求教JS问题 在线等 急
- 如何将Table中的查询结果导出到Excel中
- 如何将数据库中的内容生成shtml文件
- 有关ajax的一个小小问题(分不够可加)
- 求救:把session设为setMaxInactiveInterval(-1),为什么页面还会过期???
- 急!在线等待
- 初学者,询问哪儿有经典的jsp方面的书下载啊(如:完整的jsp高级编程),准散分的
- JSP判断日期类型的问题
- 关于servlet的配置,高分
- jsp与oracle的时间问题
default value is page. The meanings of the different scopes are shown below:page You can use the bean within the JSP page with the
<jsp:useBean> element or any of the page’s static include
files, until the page sends a response back to the client or
forwards a request to another resource.request You can use the bean from any JSP page processing the same
request, until a JSP page sends a response to the client or
forwards the request to another resource. You can use the
request object to access the bean, for example, request.
getAttribute(beanInstanceName).session You can use the bean from any JSP page in the same session as
the JSP page that created the bean. The bean exists across the
entire session, and any page that participates in the session can
use it. The page in which you create the bean must have a page
directive with session="true".application You can use the bean from any JSP page in the same application
as the JSP page that created the bean. The bean exists across an
entire JSP application, and any page in the application can use
the bean.
>>那这个bean的scope是application的
>>那我现在想问以下,不同的用户 调用这个方法时参数是不同的,照你这么说
>>一旦有个用户调用这个页面 就生成了这bean实例 那么其它用户调用时
>>它的参数是怎么办的了不是很明白你要做什么。也不懂为什么你会想不通。用不同的参数对方法进行调用可以期待会有不同的结果啊,有什么不清楚的么?搞不懂你为什么期望对不同的用户作不同的操作,scope却坚持要用application。