惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

大猫的无限游戏
大猫的无限游戏
博客园 - 【当耐特】
Cloudbric
Cloudbric
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Attack and Defense Labs
Attack and Defense Labs
爱范儿
爱范儿
The Cloudflare Blog
腾讯CDC
Security Archives - TechRepublic
Security Archives - TechRepublic
TaoSecurity Blog
TaoSecurity Blog
云风的 BLOG
云风的 BLOG
Recent Announcements
Recent Announcements
C
Check Point Blog
Schneier on Security
Schneier on Security
S
Schneier on Security
J
Java Code Geeks
B
Blog RSS Feed
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
Stack Overflow Blog
Stack Overflow Blog
博客园_首页
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
A
About on SuperTechFans
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Google DeepMind News
Google DeepMind News
阮一峰的网络日志
阮一峰的网络日志
罗磊的独立博客
A
Arctic Wolf
S
Secure Thoughts
P
Palo Alto Networks Blog
The Last Watchdog
The Last Watchdog
SecWiki News
SecWiki News
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
博客园 - 三生石上(FineUI控件)
D
Darknet – Hacking Tools, Hacker News & Cyber Security
量子位
U
Unit 42
I
InfoQ
D
DataBreaches.Net
P
Privacy International News Feed
T
Troy Hunt's Blog
博客园 - 叶小钗
T
Threatpost
博客园 - Franky
K
Kaspersky official blog
Hugging Face - Blog
Hugging Face - Blog
IT之家
IT之家
www.infosecurity-magazine.com
www.infosecurity-magazine.com
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Cisco Blogs

博客园 - 殇

java设计模式基础之设计原则 java--callback GEF七天之第五天 java基础--特殊的String GEF七天之第四天 GEF七天之第三天 GEF七天之第二天 GEF七天之第一天 距离矢量路由算法(最短路Bellman-Ford实现)实现 网络编程--简单实现javaftp服务器 网络编程--ftp客户端的实现(c#版) c#套接字的实现 好东西大家分享: JAVA学习的一些重点 最基础的数据结构(转自程序员杂志) java面试算法题(经典) (转)JSP上传视频后自动转成flv的核心JAVA方法 2008年1月编程语言排名(转) 利用Render方法生成静态页 (转)实现struts2的CRUD中的权限控制(一)
(转)实现struts2的CRUD中的权限控制(二)
· 2008-01-28 · via 博客园 - 殇

 在《 实现struts2的CRUD中的权限控制》这篇文章中,我提了一个问题,就是说在自己实现了权限拦截器后,每个action都要配置拦截器后才可以在调用他后进行权限检查,今天看了一下资料,可以设定默认的拦截器,在没有显示设定拦截器时就会使用默认拦截器,达到该目的,以后该package中的方法都会使用默认的“权限拦截器”,示例配置文件如下:

<package name="admin" extends="struts-default" namespace="/admin">
        
<interceptors>
            
<interceptor name="auth"
                class
="com.waimai.utils.AuthorizationInterceptor" />
        
</interceptors>

        
<default-interceptor-ref name="auth" />


        
<global-results>
            
<result name="login" type="redirect">
                /security/login.jsp
            
</result>
        
</global-results>

        
<action name="List" class="com.waimai.web.CaiTypeAction"
            method
="list">

            
<result>listCaiType.jsp</result>
        
</action>
        
<action name="Edit" class="com.waimai.web.CaiTypeAction"
            method
="load">

            
<result>editCaiType.jsp</result>
        
</action>
        
<action name="Store" class="com.waimai.web.CaiTypeAction"
            method
="store">

            
<result name="input" type="dispatcher">
                editCaiType.jsp
            
</result>
            
<result type="redirect">List.action</result>
        
</action>
        
<action name="Remove" class="com.waimai.web.CaiTypeAction"
            method
="remove">

            
<result type="redirect">List.action</result>
        
</action>
    
</package>

      上面得配置中大家可以看到我们使用了全局result也是基于要解决像每个action都要配置拦截器一样的重复问题,其实全局result也就是为了减少重复,回过头来看,默认拦截器是不是也可以全局拦截器呢,有这样的味道,呵呵...