2013-04-11 49 views
1

我正在尝试使用play-framework来管理子项目。在管理员调用http://localhost:9000/admin/index我无法访问管理员视图,资产存在问题。无法弄清楚什么是错的:子项目中的资产路由

val appDependencies = Seq(
// Add your project dependencies here, 
javaCore, 
javaJdbc, 
javaEbean) 

    // admin module 
    val admin = play.Project(appName + "-admin", appVersion, appDependencies, path = file("modules/admin")) 

    val main = play.Project(appName, appVersion, appDependencies, path = file(".")).settings( 
    // Add your own project settings here  
).dependsOn(admin).aggregate(admin) 

项目结构是这样的:

. 
|-app 
|---controllers 
|---views 
|-conf 
|-logs 
|-modules 
|---admin 
|-----app 
|-------controllers 
|---------admin 
|-------views 
|---------admin 
|-----conf 
|-----public 
|-----test 
|-project 
|-public 
|---images 
|---javascripts 
|---stylesheets 
|-test 

的conf /路线

GET /       controllers.Application.index() 

    -> /admin admin.Routes 

    # Map static resources from the /public folder to the /assets URL path 
    GET  /assets/*file    controllers.Assets.at(path="/public", file) 

/modules/admin/conf/admin.routes

GET  /index       controllers.admin.Application.index() 

    # Map static resources from the /public folder to the /assets URL path 
    #GET  /assets/*file    controllers.admin.Assets.at(path="/public", file) 
    GET  /assets/*file    controllers.Assets.at(path="/public", file) 

这里在admin.routes它不适用于此:GET /assets/*file controllers.admin.Assets.at(path="/public", file)

回答

0

其实管理中的GET /assets/*file controllers.admin.Assets.at(path="/public", file)不是必需的也不是/assets/*file controllers.Assets.at(path="/public", file)在管理员中。

但是需要调用不同的意见。例如viewsadmin(views/admin/does not work)