Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change context root in grails 2

I'm migrating an app from grails 1.3.6 to 2.0 and I need to change its context root. If I remember correctly, in 1.3.6 I installed the template plugin and changed:

<context-param>
    <param-name>webAppRootKey</param-name>
    <param-value>/newcontextroot</param-value>
</context-param>

I did the same in 2.0 with no success. Any hints ?

Thanks

like image 380
xain Avatar asked Oct 15 '25 13:10

xain


2 Answers

You can configure the context in Config.groovy:

// grails-app/conf/Config.groovy
grails.app.context = '/newcontextroot'

or in application.properties:

app.context = /newcontextroot
like image 199
Rob Hruska Avatar answered Oct 19 '25 05:10

Rob Hruska


Start your grails application with this command

grails -Dapp.context=/ run-app
like image 26
srsajid Avatar answered Oct 19 '25 07:10

srsajid