The implicit you've got in your controller is a RequestHeader, not a Flash. You can retrieve the flash from the request by doing something like that in your view :


It should be an Option, so you should map on it in order to process the value if it is here.


OK, I'm getting the solution. If I add @request.flash.get("success") in my form, I got an error : not found: value request. After some trial and error, I resolved my problem : I have to delete in my form @import controllers.Login._ and in my login controller, replace import play.api.mvc.{ Action, Controller, Flash } by import play.api.mvc.{ Action, Controller }. After deleted these two imports, the project compiles and works.

I'm not expert in Scala, but I suppose that was I imported implicitly two times flash, so the compiler could not choose.



I found another cause of this error : There must be no space just after the closing parenthesis in template :

@() (implicit flash: Flash, lang: Lang) -> Error

@()(implicit flash: Flash, lang: Lang) -> No error !

Related Query

More Query from same tag