As a working order, you can save your parameter on the Context.args map. This is a Map<String,Object> so that you can store everything you need for the current request.
This is an easy way to make values ββavailable in your templates without having to declare / pass them as parameters.
controller
public static Result someAction() { ctx().args.put("msg", "Hello world!"); return ok(myview.render()); }
template
@if(ctx.args.containsKey("msg")){ <p>@ctx.args.get("msg")</p> }
source share