grails - 如何在没有上下文路径的情况下部署Grails应用程序?

标签 grails web-applications contextpath

不知道我是否在这里正确使用术语“context path”,但是当前当我在本地运行Grails(2.3.6)应用程序时,它出现在http://localhost:8080/myapp上。最终,我希望将其部署到http://myapp.com的实际应用服务器上。

这可能吗?如果没有,为什么?如果是这样,怎么办?

最佳答案

在config.groovy中,只需设置:

grails.app.context = "/"

另外,您可能还应该在config.groovy中更新您的环境:
environments {
    development {
        grails.serverURL = "http://localhost:8080"
    }
    production {
        grails.serverURL = "http://myapp.com"
    }
}

关于grails - 如何在没有上下文路径的情况下部署Grails应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23812063/

相关文章:

spring-boot - CSS 中的服务器上下文路径和图像 url

java - 设置上下文路径而不考虑 Tomcat 中的 WAR 版本名称

grails - GORM中是否有 'not in'等效项?

javascript - EventEmitter <string> 的上下文 'this' 未分配给 Observable <string> 类型的 'this' 方法

java - 将遗留 Web 应用程序转换为 WAR 文件

java - 使用 maven 的 Eclipse java Web 应用程序中的组 ID 和包名称

java - 在 Web 应用程序中处理上下文的任何巧妙方法?

grails - 在 Grails 标准中使用 groupProperty 和 countDistinct

Grails 验证器不工作

grails - grails如何调试sitemesh包含