我有一种情况,我需要将路径变量作为参数传递给预授权
@RequestMapping(value="/page/{cmd}", method = RequestMethod.GET)
@PreAuthorize("hasRole(#cmd)")
public void method(@PathVariable String cmd, HttpServletRequest request, HttpServletResponse response){
// my stuff
}
Run Code Online (Sandbox Code Playgroud)
它没有工作.任何人都建议我如何在预授权中使用路径变量.