当前位置: 首页 > news >正文

怎样买网站建设织梦如何做淘宝客网站

怎样买网站建设,织梦如何做淘宝客网站,个人怎样注册一家公司,wordpress用户的区别J2EE/EJB 论坛 / XForum 里用 Filter 编程实现安全访问控制cinc 2003.03.11#xff0c; 15个回复#xff0c; 1745次浏览在 J2ee 里#xff0c;实现安全有两种#xff1a; 用声明实现安全#xff0c;就是在 web.xml 里实现安全限制。 用编程实现安全#xff0c;自己写代码…J2EE/EJB 论坛 / XForum 里用 Filter 编程实现安全访问控制cinc 2003.03.11 15个回复 1745次浏览在 J2ee 里实现安全有两种 用声明实现安全就是在 web.xml 里实现安全限制。 用编程实现安全自己写代码 在 XForum 里我们没有让 container 来管理安全检查我们使用的是自己编程实现的 用户登陆后把用户的信息存放在 session 里通过检查 session 中的用户信息就可以 知道用户是否登陆成功了。 XForum 以前的版本里这个检查过程是在分散在每个被保护的页面里做的比如 在 ViewMyThreadAction 里         final HttpSession session  request.getSession();         // If the user is null which means the user has not loged in,         // forward it to logon screen         if( userId  null || userId.length()  0 ){              final String url  /viewMyThreads.go;              request.setAttribute( ForumConstants.DEST_URL, url );              return (mapping.findForward(logon));              // Else display the users threads         }else{         。。。 如果用户没有登陆把当前页面存放在 session 中转到 logon 页面让用户登陆。 在 XForum 新版本里我们用了 Filter 技术做集中的 acl 控制 AclFilter 首先把需要包含的页面存放在一个 acl-config.xml 里 protected-resource uripost.go/uri descPost Thread Form/desc /protected-resource protected-resource uriviewMyThreads.go/uri descView My Thread/desc /protected-resource /acl-config 在 web.xml 对每个 web resource 都应用 这个 Filter filter filter-nameAclFilter/filter-name filter-classorg.redsoft.forum.filters.AclFilter/filter-class /filter filter-mapping filter-nameAclFilter/filter-name url-pattern/*/url-pattern /filter-mapping 在 AclFilter 的 doFilter 方法里检查如果请求的 uri 是 protected resource而且 session 中没有用户信息就转向到 logon 页面 这样如果以后要添加保护页面只需要在 acl-config.xml 里加上一个 protected-resource 就可以了而且也可以保护静态页面.html 的页面动态页面里的代码由于少了检查用户登陆的代码也清晰了很多。 :) 目前还实现不了现在只有两个角色   guest 用户不能访问 protected resource   登陆  用户可以访问所有的资源 不过在现有的 acl-config.xml 的基础上加以修改应该可以实现可以定义几个 role 比如 guest, user, manager然后修改 acl-config.xml 如下     protected-resource         uripost.go/uri         descPost Thread Form/desc         rolemanager,user/role     /protected-resource 实现复杂的 acl 控制使用filter是个好办法tomcat曾经使用安全拦截部件Security Interuptor (org.apache.tomcat.request.SecurityCheck)来实现web.xml中申明的资源授权。 我们完全可以参考这个类来实现自己的安全过滤器(使用JNDI或JDBC资源)。 而读取的是web.xml中的资源配置信息。这样就非常灵活了。 web.xml的配置并不需要在java中写上角色名的问题改动角色名不需要修改代码。这 是servlet规范中的一段原文SRV12.3 For example, to map the security role reference FOO to the security role with role-name manager the syntax would be:  security-role-ref    role-nameFOO/role-name    role-linkmanager/manager  /security-role-ref In this case if the servlet called by a user belonging to the manager securiyt role made the API call isUserInRole(FOO) would be true. 那么在程序中只要写明FOO使用role-link可以将其他角色也视为同义词。用 application 还是 container 管理安全确实是 J2EE 程序设计时需要好好考虑的问题 XForum 的 Filter 其实是参照 Sun Pet Store 的 SignonFilter 简化改写的 在 Pet Store 的文档里有很大一段篇幅是来讲 SignonFilter 的有兴趣的可以看看 All users in the pet store are logged in as the same system user, so they all have the same system permissions, such as whether or not they can execute a certain method. Application permissions, such as who can create an order  (registered users only), are modelled and controlled at the application level. Casual users such as the shoppers in the pet store do not have to authenticate their real-life identity in any way. In such cases, its usually preferable  to manage users in the application layer instead of at the system layer. Users with special permissions, such as system or application administrators, are  usually best represented by system users, using the J2EE login mechanisms  mentioned above. ftp://210.52.88.133/pub/doc/java/j2ee/petstore/sample-app1.3.1.pdf 回应这个帖子
http://www.zqtcl.cn/news/733480/

相关文章:

  • 外链网站有哪些空港经济区内的建设工程网站
  • 企业网站开发价阿里云快速备份网站
  • 大型电子商务网站建设成本ai网页生成
  • 网页播放视频 网站开发常用网站搜索引擎
  • 制作一个购物网站要多少钱做创意小视频的网站
  • 淇县网站建设软件定制流程
  • 17网站一起做网店代发流程wordpress悬浮 联系
  • 如何查网站外链快速开发平台 免费开源
  • 做网站有哪些流程怎么做网站电影
  • 做街机棋牌上什么网站发广告网站策划和运营
  • 建网站是什么专业类别阳江网红人物
  • 网站建设工作描述株洲市建设质监站网站
  • 做网站 橙色怎么搭配吐鲁番市网站建设
  • 企业信息网站衡阳高端网站建设
  • 中小学网站建设小程序开发费用是多少
  • 网站开发项目可行性分析单位logo设计
  • 做最好的美食分享网站网站源码网站
  • 宝塔搭建app教程360优化大师下载
  • 杭州网站制作 乐云践新开发公司竣工员工奖励计划
  • 绍兴市越城区建设局网站网站策划运营方案书
  • 怎么查网站备案信息查询wordpress 新安装 慢
  • 做一个卖东西的网站深圳市住房和建设局网站变更
  • 一个公司做几个网站绵阳房产网
  • 广州做网站服务怎样做网站反链
  • 淘宝客网站制作视频教程flash做网站的论文
  • wordpress keywords 用逗号 区分关键字南昌网站优化方案
  • 清华大学网站建设方案郑州建网站企业
  • 闸北网站优化公司网站表格代码
  • 网站里面如何做下载的app深圳企业社保登录入口
  • 中国网站建设哪家公司好网站开头flash怎么做