score:0

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
    views.html.secure.Registration.passwordChange(request, userName, form)
  }

The code above is part of MyViews.scala code.

score:0

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