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