[2.4.0-M3-scala] Cannot resolve assets in submodules

146 views
Skip to first unread message

Taig

unread,
Apr 17, 2015, 7:27:34 AM4/17/15
to play-fr...@googlegroups.com
Hi everyone,

I have a very simple multi-project layout: In the root folder there is a main application which does nothing but forward all requests to the module/ application. The Build.scala contains routesGenerator := InjectedRoutesGenerator for both projects, but it also didn't work for me without this setting (btw why is the routesGenerator not working if I only set it in the main project, but apply it to ThisBuild?).

This is the code of my Assets controller which I'm not 100% certain about as it seems to be not documented yet:

package controllers.module

import javax.inject.{Inject, Singleton}

import play.api.http.HttpErrorHandler

@Singleton
class Assets @Inject() ( errors: HttpErrorHandler ) extends controllers.AssetsBuilder( errors )

However, all urls to asset files result in 404s, the Assets controller is unable to find the files.

<script src="@controllers.module.routes.Assets.at("javascripts/module.js")" type="text/javascript"></script>

Thank you!
test-project.zip

Taig

unread,
Apr 18, 2015, 7:49:28 AM4/18/15
to play-fr...@googlegroups.com
It works if I change my module asset route from

GET        /assets/*file        controllers.module.Assets.at(path="/public", file)

to

GET        /assets/*file        controllers.module.Assets.at(path="/public/lib/module", file).

Is that working as intended?

Reply all
Reply to author
Forward
0 new messages