Using Play Framework, I was wondering if it was possible to load some vars in the template like I do in other controllers.
I mainly think about my "STATIC_URL" var that contains the path to the static files, that changes between my DEV/PROD modes.
Or at least, which alternatives I can use to make this works?
Your question is not very clear and could do with an example of what you are trying to achieve. However if what I think you are asking is correct try the following in your controller:
//This will run before any controler request is called
@Before
static void globals() {
renderArgs.put("staticUrl", staticUrl);//Adds staticUrl object to the renderArgs map.
}
Then in your template use ${staticUrl} to access the value from the renderArgs map.