Spring Security可以@PreAuthorize在Spring控制器方法上使用吗?
3 回答

饮歌长啸
TA贡献1951条经验 获得超3个赞
是的,它工作正常。
你需要<security:global-method-security pre-post-annotations="enabled" />在...-servlet.xml。它还需要CGLIB代理,因此您的控制器不应具有接口,或应使用proxy-target-class = true。
添加回答
举报
0/150
提交
取消