i.e.
我使用 Spring MVC RequestMapping 映射了各种 URL
@RequestMapping(value = "/mystuff", method = RequestMethod.GET)
@RequestMapping(value = "/mystuff/dsf", method = RequestMethod.GET)
@RequestMapping(value = "/mystuff/eee", method = RequestMethod.GET)
etc
我想在大约 90% 的请求之前运行一些常见操作。这些跨多个控制器。
有没有办法在不深入 AOP 的情况下做到这一点?如果我必须使用方面,有关于如何做到这一点的指导吗?!
Thanks!
更多信息:
它是为了运行一些特定于应用程序的安全性 - 我们被链接到父级安全性设置,我们需要读取和调用它,然后需要在我们的大多数调用(但不是全部)之前访问 cookie。
您可以使用拦截器:
http://static.springsource.org/spring/docs/current/spring-framework-reference/html/mvc.html#mvc-handlermapping http://static.springsource.org/spring/docs/current/spring-framework-reference/html/mvc.html#mvc-handlermapping
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)