我想通过以下方式使用Spring Method Security来保护我的MVC控制器:
@Controller
public class MyBean {
@RequestMapping(value = "/myUrl", method = { RequestMethod.GET })
@PreAuthorize("@myBean.isAccessible()")
public ModelAndView doSomething(HttpServletRequest request, HttpServletResponse response) {
...
}
public boolean isAccessible() {
if (...) {
return true;
}
return false;
}
}
是否有可能通过引用@myAction
替换this
?