I'm writing webapp using Spring 3 MVC with annotations. I use jsp for view layer. I have a few basic templates and many templates that I want to include into this basic templates in depend of controller.
I know that I can add template name to model inside controller, but it is not best way I think. I thin开发者_Go百科k some declarative way must exists.
What the best way to do this.
Thanks.
You may try Apache Tiles (integration with Spring MVC, petcare sample).
With Tiles you can break your templates into subtemplates, assemble them declaratively into tiles' definitions and use definition names as view names returned from controllers.
精彩评论