1、interceptor:workflow,实际是用于action的执行顺序及执行的方法集,主要是验证后execute()。
2、interceptor:prepare,首先执行实现了Preparable接口的action中的prepare方法,然后再execute;
3、servlet-config,在xwork中声明后,在类中implements sessionAware 或者其他http内置变量,在类中定义变量并set注入后,可以直接是用之!
2、interceptor:prepare,首先执行实现了Preparable接口的action中的prepare方法,然后再execute;
3、servlet-config,在xwork中声明后,在类中implements sessionAware 或者其他http内置变量,在类中定义变量并set注入后,可以直接是用之!
本文介绍了Struts2框架中拦截器的工作原理,包括workflow拦截器、prepare拦截器的作用及执行流程,以及如何通过servlet-config进行类级别的配置。
3605

被折叠的 条评论
为什么被折叠?



