项目中采用Interceptor来过滤URL来决定哪些能够在不登陆的状况下访问,哪些必需要登陆才能够访问;mvc
public class SessionTimeoutInterceptor implements HandlerInterceptor {
此时须要在servlet.xml中配置<mvc:interceptor>测试
同时亦采用AOP来记录日志,使用注解方式.net
@Component
@Aspect 日志
同时在servlet.xml中配置code
<aop:aspectj-autoproxy></aop:aspectj-autoproxy>
经测试发现,interceptor先于AOP执行。
xml