Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

included header & footer files don't show up in a JSP page

843838Sep 22 2005
All pages in my site include a header.jsp and a footer.jsp

for including header.jsp
  <tr><td>
  <jsp:include page="<%=request.getContextPath()+"/header.jsp" %>"/>
  </td></tr>    
for including footer.jsp
  <tr><td>
  <jsp:include page="<%=request.getContextPath()+"/footer.jsp" %>"/>
  </td></tr>    
Most pages work well. Only one page has problem to show header and footer.

This page, called 'SearchResult.jsp' in 'search' folder, that is <project>/search/SearchResult.jsp. It will show search results after search process is finished.

I have a jSp page, called 'search.jsp' at root, that is <project>/search.jsp. It has a form to take search criteria from users.
<form name="search"method="POST"  action="/servlet/searchProcess" 
     onsubmit="return validateForm()">
....
</form>
In searchProcess.java file, after search process is done,

I use
getServletConfig().getServletContext().getRequestDispatcher("/search/SearchResult.jsp").forward(request, response);
to forward to result page (<project>/search/SearchResult.jsp). No problem to show the search result, but no header and footer appear although they are included in this jsp page.

Does anyone know what's wrong in my code?

Thanks in advance.

northcloud
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 20 2005
Added on Sep 22 2005
0 comments
218 views