2013-11-21 51 views

回答

4

您可以設置它在你的application.conf或使用JVM標誌

-Dapplication.router=my.application.Routes

https://github.com/playframework/playframework/blob/2.2.1/framework/skeletons/java-skel/conf/application.conf#L20

# Router 
# ~~~~~ 
# Define the Router object to use for this application. 
# This router will be looked up first when the application is starting up, 
# so make sure this is the entry point. 
# Furthermore, it's assumed your route file is named properly. 
# So for an application router like `conf/my.application.Router`, 
# you may need to define a router file `my.application.routes`. 
# Default to Routes in the root package (and `conf/routes`) 
# application.router=my.application.Routes 
+1

路由文件可以包含另一條路線的文件,就像application.conf可以嗎? – zzhang

+0

是的一個真實生活的例子是在https://github.com/beligum中看到http://www.playframework.com/documentation/2.2.x/SBTSubProjects「拆分路線文件」。 – Schleichardt

相關問題