开发者

Best way to include sub-templates into templates in Spring MVC

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜