如何在Play Framework的配置文件中使用“war.context”?
请查看 Google 网上论坛上的此帖子,了解您所问问题的描述。
http://groups.google.com/group/play-framework/browse_thread/thread/b4783c821fd29898?pli=1 http://groups.google.com/group/play-framework/browse_thread/thread/b4783c821fd29898?pli=1
从本质上讲,它所说的是。
在您的 application.conf 文件中,您设置一个属性,例如
war.context=/MyAppName
然后,在您的路由文件中,将其设置为包含您的 WAR 上下文,如下所示
# Set context name
%{ ctx = play.configuration.getProperty('war.context', '') }%
# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~
# Home page
GET ${ctx}/ Application.index
# Map static resources from the /app/public folder to the /public path
GET ${ctx}/public/ staticDir:public
# Catch all
* ${ctx}/{controller}/{action} {controller}.{action}
因此,您可以看到,无论您在 war.context 中放置什么,您都可以将其放入路线中以选择正确的路径。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)