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