How do you separate the rendering concerns from the controller?
I'm not sure if my question violates Play! architecture or is inline with it, or that I don't understand how to achieve a desired result.
Basically, I want to create an app that can render what the client prefers. So if the client prefers HTML, that can be returned, if the client prefers JSON or XML etc. that can be arranged. I.e. the controller doesn't care. The controller receives input, manipulates the Model and then selects those parts of the model that should be rendered and possibly the flow, and then calls Play! to select the proper rendering.
In other words I love how Play! can figure out how to make it all work by using simple conventions. In this case, the selection of the rendering seems to be left to the Controller to figure out. Is this by design? Or is this my lack of understanding in how to make Play! work?
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Leo
- Solved:
- Last query:
- Last reply: