I am trying to provide modular specific routing that can be included in Play applications using the standard conf/routes route file as:
-> /psmod1 com.escalesoft.psmod1.ctrl.Routes
Compilation error received:
type Psmod1Assets is not included in the package com.escalesoft.psmod1.ctrl
To do this, I performed two steps, as indicated in the official documentation, in All classes and classes of controllers should be defined in the package controllers.admin
1. Define asset and controller classes in your own package
Define the asset class Psmod1Assets.scala as:
package com.escalesoft.psmod1.ctrl
import play.api.http.LazyHttpErrorHandler
object class Psmod1Assets extends controllers.AssetsBuilder (LazyHttpErrorHandler)
The above replacing an object by class resolves the issue
2. Split route file
Define the specific route file /conf/com.escalesoft.psmod1.ctrl.routes as:
# Routes
If you like, you can check or clone the code of my small test project on github:
The project is configured to work using standard controllers.Assets . Go to the /conf/com.escalesoft.psmod1.ctrl.routes file (check it com.escalesoft.psmod1.ctrl.routes ) and replace the line controllers.Assets with the line com.escalesoft.psmod1.ctrl.Psmod1Assets to reproduce the compilation error .
I have already checked the following resources:
source share