Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Kaua Costa   on May 17 In Java Category.

  
Question Answered By: Ludo Ricci   on May 17

If you want all your jsp files using a common  view, then you should make a file with the the features and include it in every JSP files that you want to display that common feature.

For example  you have a file called: header.jsp. this file containing a banner that you want to use in all your jsp pages. You have another templete file called footer.jsp that includes everything that you want to be displayed in the bottum of all your jsp files.

In the above cases you use the ( %@include=”filename”%) directive and place it in the appreciate place of your jsp file:

<%@ include file="banner.jsp” %>

This directive can be also used for dynamic feature. For example a jsp file that create or destroy a database. You use the include directive in each file that reuses the resource referenced by the directive.

There is also a more flexible approach called " Templete Tag Library". Sun has a very good tutorial about it. Here is the link: java.sun.com/.../TagLibrariesTOC.html

Share: 

 

This Question has 4 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Solution for common view pages Or get search suggestion and latest updates.


Tagged: