Ho un Gioca quadro applicazione, versione 2.4 la migrazione a 2,5, tutto fatto! ma genera un errore nella mia azione personalizzata con BodyParser,Gioca Errore 2.5 Migrazione: azione personalizzata con BodyParser: non riusciva a trovare valore implicito per il parametro mat: akka.stream.Materializer
def isAuthenticatedAsync[A](parser: BodyParser[A])(f: => Long => Request[A] => Future[Result]) = {
Security.Authenticated(userId, onUnauthorized) { user =>
Action.async(parser)(request => f(user)(request))
}
}
Utilizzare questa:
def upload = isAuthenticatedAsync(parse.maxLength(5 * 1024 * 1024, parse.multipartFormData)) { userId => request =>
//Logger.info(s"")
request.body match {
case Left(MaxSizeExceeded(length)) => Future(BadRequest(Json.toJson(ResultTemp("Your file is too large, we accept just " + length + " bytes!"))))
case Right(multipartForm) =>
genera un errore:
could not find implicit value for parameter mat: akka.stream.Materializer
[errore] def upload = Action.async (parse.maxLength (5 * 1024 * 1024, parse.multipartFormDa ta)) {richiesta =>
molte grazie a voi! –
sei il benvenuto @ ĐạtThành. Goditi scala. –