0

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?

Thanks,
- Jeff Miller

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by ~s.o.s~
1

> 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.

Edited by ~s.o.s~: n/a

Votes + Comments
Good suggestion.
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.