This one has been driving me crazy today. Since upgrading to Grails 1.2 and Weblogic 10.3 the default root mapping for “/” stopped working. Here’s what I have…
I have this URL mapping:
"/"(controller:"IGive", action:"index" )
I have a controller named IGiveController with an index closure
def index = {
render "foo"
}
When I go to my application running in the embedded Tomcat and Jetty with http://localhost:8080/mycontext/ I get “foo” returned property. But when I build a war and deploy to Weblogic 10.3 I get a 404.
I downgraded to Grails 1.1.2 and it still didn’t work on Weblogic 10.3 but the error was more descriptive
Could not open ServletContext resource [/WEB-INF/grails-app/views/index.gsp]
So it seems like it’s completely ignoring my URL Mapping for “/” but other URL Mappings that are deeper are working. Any clues??
I think this is more related to Weblogic – I am seeing the same on Weblogic 9.2 – but not on Tomcat or Jetty. Doesn’t hit my UrlMapping:
I think Weblogic is being smart and converting / -> index.gsp which then comes back as a 404.
There is a slightly ugly workaround – just add a mapping like this:
and that seems to do the trick. Anyone have a better way to fix this???