My Play 2.0 application runs under different directories during development and in production:
During dev we use /
, in production it runs as /crm/
.
Is it possible to define a "root directory" of some sort for play?
This article suggests using the isDev()
sort of methods and this one to use a config variable, but it seems like the routes file no longer allows code inclusion: adding %{ }
—style tags to the routes file results in compilation errors.
In 2.0 or 2.0.1 you can't do it.
If you use the trunk-version you can define a property:
application.context="/AwesomePlayApplication"
This property can be set by in the usual way at production. But this is only possible with the future version.
由于似乎没有其他解决方案,我决定使用一个Shell脚本来修改部署时的路由文件,并为每个路由添加必要的前缀。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.