scala - Play 2.2 Filter in Subproject -
i'm trying intercept request in subproject , add request/block response. right i'm trying prove interceptor working , can't show println
. based on reading, i've got this:
package filters.edmoderator import play.api.mvc._ import scala.concurrent.future import scala.concurrent.executioncontext.implicits.global object requiremoderation extends filter { def apply(next: (requestheader) => future[simpleresult])(request: requestheader): future[simpleresult] = { val result = next(request) println("filter applied") result } } object global extends withfilters(requiremoderation)
like said, println doesn't work. need in build.sbt, else?
you need declare global
object in global.scala
in root package. put in other package have update application.conf
accordingly.
import play.api._ import filters.edmoderator._ object global extends withfilters(requiremoderation)
Comments
Post a Comment