when loading jsp pages with a servlet
When you load your jsp pages with a servlet and you have a page that consists of....
header.jsp
mycontent.jsp
footer.jsp
Is it best to have your servlet load all 3 jsp pages or do you load your mycontent.jsp page which in turn loads the other two jsp pages? My first thought would be to have the servlet load all jsp pages, but then I was thinking there will be times when a jsp might want to load a jsp inside of it.
Any recommendations or best practices?
[494 byte] By [
javaksa] at [2007-10-3 3:13:25]

I think you do not have to consider the loading sequence. When you use javascript to reload a page, things will become more and more complicated.
I would recommend to use the fourth page to include the header, mycontent and footer.
Make sure the header page, mycontent and footer can operate separately. This means mycontent page do not depend of the result of header page.
It is much better if you know how to use framework like Struts.
You use action to process and store the result in session, then your header, mycontent and footer can read the result from session separately and you don't have to consider the loading sequence.