Reputation: 35864
Using Grails 2.0.1 (upgraded from 1.3.7). In application.properties I have app.context = "/" and all is generally working well. However, my redirects now attempt to include an app context.
redirect action: "edit", id:genAttribute.id
So instead of
http://localhost:8080/genAttribute/edit/55
I end up with
http://localhost:8080/bh/genAttribute/edit/55
which of course doesn't work. Another interesting piece of this is that the g:link tag works fine. It just seems to be the redirect calls from my controllers.
Upvotes: 2
Views: 929
Reputation: 47995
The problem is an invalid grails.serverURL config property, it's explained here in the "Redirects" section, quoting:
As a side-effect, the redirect() is now dependent on the grails.serverURL configuration setting. If this doesn't match the URL of your application, redirects will stop working.
The simplest way to avoid this problem is to remove the setting unless you need it. If you need it (usually for production deployments) then the value should already match the URL of your application. This mostly impacts development where old projects often have a legacy value that doesn't work.
Upvotes: 1