<url-pattern> 在筛选器映射中无效 *。 在 Glassfish 上部署 Grails 3 应用程序期间



在Glassfish 4.1.1容器上部署Grails 3应用程序时,我得到了下一个错误代码:

Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is java.lang.IllegalArgumentException: Invalid <url-pattern> * in filter mapping.
我UrlMappings.groovy

:

class UrlMappings {
    static mappings = {
        "/$controller/$action?/$id?(.$format)?"{
            constraints {
                // apply constraints here
            }
        }
        "/"(view:"/index")
        "500"(view:'/error')
        "404"(view:'/notFound')
    }
}

我是否缺少任何配置?

这可能是由于默认配置:

https://github.com/grails/grails-core/blob/master/grails-plugin-controllers/src/main/groovy/org/grails/plugins/web/controllers/ControllersGrailsPlugin.groovy L82

默认值:

https://github.com/grails/grails-core/blob/master/grails-core/src/main/groovy/grails/config/Settings.groovy L185

试着在grails-app/conf/application.yml:

中设置这个
grails:
   web:
     servlet:
         path: "/"

最新更新