3
votes

I have a Grails 2.0 webapp and when I try to go to an url, for example http://localhost:8080/${myapp}/controller/action it always redirects to http://localhost:8080/controller/action without the name of my webapp. This is my UrlMappings.groovy

class UrlMappings {
static mappings = {
  "/$controller/$action?/$id?"{
      constraints {
         // apply constraints here
      }
  }

  "/"(controller:"/admin")
  "500"(view:'/error')
}

}

And this is my application.properties

#Grails Metadata file
#Thu Feb 09 12:22:14 CET 2012
app.grails.version=2.0.0
app.name=appname
app.servlet.version=2.4
app.version=0.1
plugins.hibernate=2.0.0
plugins.tomcat=2.0.0

any suggestions why it redirects to the wrong url?

thanks for your time

1
Did you set grails.app.context="/appname" in your Config.groovy?seth.miller
thanks for your response, I'll try it on monday, I'm not at the officeAlex M

1 Answers

4
votes

The problem is solved. In Config.groovy my server url was wrong

grails.serverURL="http://localhost:8080"

I had to use

grails.serverURL="http://localhost:8080/appname"

thanks