spring-boot - Spring boot Restcontroller @RoleAllowed 在接口实现中不起作用
问题描述
我创建了一个带有默认方法的接口,该方法定义了@RequestMapping
and@RoleAllowed
并在其中实现Restcontroller
。但是该@RoleAllowed
属性不是从默认方法说话的。PFB 代码
public interface Resource{
@REquestMapping(value="/api/test",method=RequestMethod.GET)
@RoleAllowed({"READ_ONLY"})
default public String testEndPoint(){
return "defaultmethod";
}
}
public class ResourceImpl implements Resource{
@override
public String testEndPoint(){
return "ResourceImpl";
}
}
}
@RoleAllowed
不工作ResourceImpl
。如果我没有覆盖testEndPoint
方法,它工作正常
解决方案
推荐阅读
- android - React Native 错误:TypeError:null 不是对象 _RNGestureHandlerModule.default.Direction
- python - 熊猫,是约会假期吗?
- cypress - 使用 Cypress-promise 对我来说,异步等待在循环内部不起作用
- graphviz - 如何用 GraphViz 分离节点的图片和标签?
- c - 在 c11 中使用 clang 编译的程序中调用 DX12 函数时出现问题
- c# - 使用 memoryStream 时已添加具有相同 key 的项
- python - 计算两个事件之间的时间差,同时忽略 Python 中不匹配的事件
- python - 使用 for/while 循环和 range() 列出值
- python - 在 python 中不允许 AssertionError for wordcloud 并且不要运行
- python - Scipy UnivariateSpline 在某些情况下退出代码 -1073741819