Hey guys,
I'm currently learning JSP and Java using Netbeans, and I was wondering if there was an easy way to create a web template layout. For example, using a single header, footer, and navigation bar for all pages. In Ruby on Rails, there is a "layouts" view, which you can define an .rhtml page and simply put the yield tag, <%= yield %> . Once this is done, all of the views you create will simply append the layout where the yield tag is. Is there something similar to this that I can use for a Java Web App?
> Is there something similar to this that I can use for a Java Web App?
Yes, you can either use the <jsp:include> standard action or tag files to include reusable view templates in your web pages.
Edit: Just keep in mind that the above mentioned techniques include the content at runtime. If you are pretty sure that your re-usable views would never host dynamic content, go with the include directive which includes the content at translation time as opposed to run-time.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.