修改grails 2中的上下文根



我正在将一个应用程序从grails 1.3.6迁移到2.0,我需要更改其上下文根。如果我没记错的话,在1.3.6中我安装了模板插件并修改了:

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

我在2.0中做了同样的事情,但没有成功。有没有提示?

谢谢

您可以在Config.groovy中配置上下文:

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

或在application.properties中:

app.context = /newcontextroot

用下面的命令启动grails应用程序

grails -Dapp.context=/ run-app

我知道在Grails 3.3.9版本中:

项目/grails-app/conf/application.yml

添加

server:
    contextPath: /yourcontextpath
    port: 9214 

最新更新