Accepted answer

The solution was very simple and sleek - instead of populating user from HTTP Context object (which was unavailable in this part of code), I populated user from implicit request and then passed variable to my custom template:

  def getPasswordChangePage[A](implicit request: SecuredRequest[A], form: Form[ChangeInfo]): Html = {
    val userName = request.user, userName, form)

The code above is part of MyViews.scala code.


Looks like user is null. Are you populating it in your code?

You also need to add a query in your user model to find it. For example check this:

Create model class in Scala with Play 2 Framework

Related Query

More Query from same tag