Grails url映射排除dbconsole



我有一个单页web应用程序,grails的url映射包含

"/* *"(观点:"/指数")

以及少数以/api/*开头的路由当我试图访问带有插件的/dbconsole时,问题就发生了。这仍然是通过第一个映射提供的。我尝试像这样排除dbconsole

"/$灰烬?(view: "/index", constraints {ember(notEqual: 'dbconsole')})

但是它总是抛出一个异常

您可以在URL映射中定义一个排除:

class UrlMappings {
    static excludes = ["/dbconsole*"]
    static mappings = {
        //your app's usual URL mappings
    }
}

由于dbconsole不是通过通常的URL解析过程提供的,因此您仍然可以访问它

最新更新