Grails 3和Spring @RequestMapping [英] Grails 3 and Spring @RequestMapping
问题描述
这些请求似乎不会触及由spring-security-oauth lib配置的任何端点。无论如何要保证请求到达jar中的端点?
确保由@RequestMapping配置的端点显示在一个使用Java配置的Grails 3应用程序,您必须在Application.groovy中使用以下设置:
@ComponentScan(my.org .config)
class Application扩展GrailsAutoConfiguration {
static void main(String [] args){
GrailsApp.run(Application)
请勿使用以下方式使用application.yml:
grails:
profile:web
spring:
bean:
包:
- my.org.config
尽管bean将被拾取,但@RequestMapping将无法访问。
In Grails 3 I'm trying to use spring-security-oauth, which provides a few endpoints via the @RequestMapping I can see in the mbeans that the path is configured but any request always hits grails and returns a 404.
The requests never seem to hit any of the endpoints configured by the spring-security-oauth lib. Is there anyway to insure the requests hit the endpoints in the jar?
To make sure the endpoints configured by @RequestMapping show in a Grails 3 app using Java config you have to use the following set up in Application.groovy
@ComponentScan("my.org.config")
class Application extends GrailsAutoConfiguration {
static void main(String[] args) {
GrailsApp.run(Application)
}
}
Do not use application.yml in the following way:
grails:
profile: web
spring:
bean:
packages:
- my.org.config
While the beans will be picked up anything with @RequestMapping will not be accessible.
这篇关于Grails 3和Spring @RequestMapping的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!