944,143 Members | Top Members by Rank

Ad:
  • JSP Discussion Thread
  • Unsolved
  • Views: 1326
  • JSP RSS
Nov 5th, 2009
0

Layout template

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ibanez270dx is offline Offline
4 posts
since Nov 2009
Nov 5th, 2009
0
Re: Layout template
If you are familiar with struts then try to use tiles.
Moderator
Reputation Points: 2136
Solved Threads: 1228
Posting Genius
adatapost is offline Offline
6,527 posts
since Oct 2008
Nov 8th, 2009
1
Re: Layout template
> 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.
Last edited by ~s.o.s~; Nov 8th, 2009 at 2:16 pm.
Super Moderator
Featured Poster
Reputation Points: 3241
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,873 posts
since Jun 2006

This thread is more than three months old

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.
Message:
Previous Thread in JSP Forum Timeline: sending email by using JSP
Next Thread in JSP Forum Timeline: Eclipse Tomcat Not Responding





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC