【发布时间】:2014-10-17 14:46:05
【问题描述】:
我有一个普通的 spring-mvc 项目,并且我还在构建一个 rest 模块作为单独的 jar 文件。目标是当我的类路径中有rest jar 时,将普通网站映射到/,并将spring-data-rest 存储库映射到/rest。对于rest 模块,我定义了RepositoryRestMvcConfiguration 和WebApplicationInitializer,一切正常。
所以现在我想在rest 模块中添加更多URLs(如/synchronize 和/authenticate 等),但只要我在rest 模块中添加控制器,它们就是由父应用程序上下文(网站/)拾取。我尝试在RepositoryRestMvcConfiguration 中将它们指定为bean,但它们仍然被另一个父上下文拾取,并且父上下文的过滤器被触发。当我通过/rest 访问 spring-data-rest 时,不会触发任何过滤器。
所以我想知道:有没有我可以在 RepositoryRestMvcConfiguration 中覆盖的方法,以便我可以添加额外的 url 处理程序映射?
【问题讨论】:
标签: spring-data-rest