码迷,mamicode.com
首页 > 其他好文 > 详细

struts2拦截器demo

时间:2014-05-29 12:06:45      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:c   style   class   http   a   color   

按照网上的一些资料配置的,期间也出现过几个错误。

其中有个错误,是关于struts.xml里面package配置的问题,因为里面的几个标签是有顺序的。

顺序是:

result-types
interceptors
default-interceptor-ref
default-action-ref
default-class-ref
global-results
global-exception-mappings
action*(就是所有的action放到最后)

其它倒是没什么问题。

拦截器用来拦截未登陆的情况。未登录的话,session里面为空,跳转到登陆界面,和过滤器有点像。

demo地址:http://pan.baidu.com/s/1sjJe521

struts2拦截器demo,布布扣,bubuko.com

struts2拦截器demo

标签:c   style   class   http   a   color   

原文地址:http://www.cnblogs.com/juepei/p/3756636.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!