Can someone explain this UrlMappings ?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Can someone explain this UrlMappings ?

İsmail Hakkı Ayaz
Hello,

I use Grails 3.3.9. index.html is my spa and it is under src/main/webapp

I have AController and BController and both have namespace defined as "v1"
I have following `UrlMappings` 
class UrlMappings {
   
static mappings = {
       
"/$namespace/$controller/$action?/$id?(.$format)?"{
       
}
       "/" (uri: '/index.html')
    }
}

And my server.contextPath is  "/app/" in application.yml

All requests to controllers work flawlessly. For ex. /app/v1/a/someAction   /app/v1/b/anotherAction

My question is how the request "/app/a" resolves to the controller A. It seems like it ignores namespace defined in the mapping. It is not defined to do so in my UrlMappings. When it is defined as above this request should fail. If this is expected behavior how could I prevent it. If it is not I should open an issue for this.

Thanks.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/8e3c4abc-1442-40e1-9f2a-01a723eee210%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.