I am using Spring MVC with JSP views. Each JSP page has a similar structure - headers, content, footers, possibly a sidebar, etc. Looking back at “best practices,” people seem to “include” footers and headers, but that means that every JSP page has these “included” statements, giving a fixed format. In my opinion, the best solution would include nested views, where the basic template is expanded with information relevant to the page in question. One of the advantages of this approach is that you can use the default values in the base template without repeating them elsewhere. Another advantage is that you can further separate the structure and content (the "header" and the "footer", which is structural, and therefore belongs to the base template) on pages that contain a lot of text (think about the help pages - you can put it all in the database, but why bother, especially since with Spring you can resolve different views through the locale?).
There seems to be no support for this at the MVC level in Spring, but it can be implemented in JSP using custom tags and there really is a rather clumsy attempt here (this may explain what I want better than this question, although I think that you could make it less intrusive).
Anyway, my question is: does this already exist as a (popular / standard) tag library? I am happy to write custom tags, but my impression of this material (website creation) is that there is already a huge selection of solutions, with most of the work going on choosing the right tools (for example, Spring). Thanks.
source share