标签:
拦截器的用途:
拦截器适合封装一些通用处理,便于重复利用。1、创建拦截器组件
public String interceptor(ActionInvocation invocation) {
//拦截器--前部分处理
invocation.invoke(); //执行action和result
//拦截器--后续处理
}<package> <interceptors> <interceptor name="别名" class="实现类"/> //...其他interceptor </interceptors> </package>
<interceptor-stack name="myStack">
<interceptor-ref name="firstInterceptor"/>
<interceptor-ref name="secondInterceptor"/>
</interceptor-stack>默认引用拦截器
标签:
原文地址:http://blog.csdn.net/xie_xiansheng/article/details/51150146