項目中採用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