java中getAttribute和findAttribute的区别

时间:4年前   阅读:4977

getAttribute:

abstract  Object getAttribute(String name)
          Returns the object associated with the name in the page scope or null if not found.

  在page scope内查找与name相关的属性,找到返回就返回对象,找不到就返回null。 

findAttribute:

abstract  Object findAttribute(String name)
          Searches for the named attribute in page, request, session (if valid), and application scope(s) in order and returns the value associated or null.

  依次在page,request,session(如果有效的话)和application Scope(范围)查找以name为名的Attribute,找到就返回对象,都找不到返回null。 

总结:它们的区别是查找范围不同

本站声明:网站内容来源于网络,如有侵权,请联系我们https://www.qiquanji.com,我们将及时处理。

微信扫码关注

更新实时通知

上一篇:50ETF期权日报:认购隐波修复回升 认沽隐波继续走低

下一篇:骑士cms v4.0微信通知模板配置说明文档

网友评论

请先 登录 再评论,若不是会员请先 注册