Reputation: 12336
All of the examples of view rendering in play documentation I've seen so far required actually specifying a view and then making a render() call.
Is there a way to configure a default view for each action and then have the action automatically render the default view specified?
Upvotes: 0
Views: 57
Reputation: 11479
In play 2.0 the templates actually are functions that return instances of the class Html which the Actions then use to create a reply, this means that you must call them to get any output.
You might be able to create some reflection trixery to achieve what you describe but there is nothing like that built into play. I personally think that this is one of the really strong points of Play, allowing the compiler to check that all parameters for the templates are given and of the right type instead of getting runtime errors because some mapping or context-object were of the wrong type.
Upvotes: 1