View Full Version : How can I do this with jsp?

09-05-2003, 04:24 PM
I am creating a new website for my company. So there are altogether 25-30 pages and in all the pages the top portion,the left nav bar and the footer is similar. So I am planning to split these into templates (a top navbar, left side bar, middle content - this will be different for different pages, a footer). How can I use a jsp includes to do this project? Meaning when I split these pages the portions would be named as .txt? Then I have to use a jsp to call all these .txt to make the right page? Can some one please give me a little explanation how this could be done?

09-15-2003, 08:08 PM
JSP files can be made into include files.

In the main jsp file you would have

<%@ include file="Header.jsp"%>

The partial jsp file (Header.jsp) would contain the code that is needed to reuse.

There is one book (can't remember which right now) that suggests that the partial jsp files be named .jspf that way you can tell your IDE not to check those files. I have not used that convention but it makes sense.