Spring AOP 入门范例
Spring AOP 入门实例以Struts2+Spring为例,要求必须在登录之后才能实现某一链接。如果未登录则抛出异常,跳
Spring AOP 入门实例
以Struts2+Spring为例,要求必须在登录之后才能实现某一链接。如果未登录则抛出异常,跳转到异常页面。
假设链接为:http://localhost:8080/aop/test.action
Struts2的配置文件struts.xml文件:
?

Spring中的TestAction配置:
?

?

?

?

?

<error-page> ???????<exception-type>exception.NoLoginException</exception-type> ???????<location>/error.jsp</location> ??</error-page>??
1 楼 Roshan2 2011-09-30 http://lijiejava.iteye.com/blog/1180331