Play.http.context or prefix is not picked up by helper.form while using compile-time DI play 2.7 or 2.6

play.http.context = /tests

login.scala.html looks like
@helper.form(action = routes.LoginController.authenticate)

Route looks like
POST /login controllers.LoginController.authenticate

html generated

“form action=”/login" method=“POST”"

I am expecting action to be action="/tests/login" as my play.http.context is “/tests” and also have added prefix to have “/tests” white creating route using BuiltInComponentsFromContext

Instead of passing prefix as parameter in the new Route creation use withPrefix ("/testing") . This has fixed this issue .

It is confusing why do they have parameter in Routes which accepts prefix . As with it assets and forms actions doesn’t work properly

1 Like