I am currently writing an web application where you need to log in, using username and password. The next step in the process is to select a Project in which the logged in user is involved.
Once the project is selected and the submit button has been clicked, a servlet is called to prepare the selected project and create a requestDispatcher
and .forward
the req and resp to my mainpage.
The layout of the mainpage:
The header div:
<div><jsp:include page="header.do" flush="true"/></div>
The body div:
<div> code that is present in the mainpage.jsp </div>
The footer div:
<div><jsp:include page="footer.do" flush="true"/></div>
Lets say that these 3 divs make up the mainpage.
After forwarding the page with the requestDispatcher
I get to see the mainpage's content. However the <jsp:include>
's are not loaded (the DIV's are left empty). Only when I refresh the page (doGet
, I assume) the includes will load correctly.
Is there anyway to let the includes load on a doPost requestDispatch execution?
**Note: The syntax of the requestDispatchers is exactly the same in the doPost
and doGet
methods.
If more clarification is needed, or extra code. Please let me know.
EDIT
Servlet container used: Tomcat 6.0
Web.xml:
<!--- Servlet Mapping for Project Selection Servlet-->
<servlet>
<servlet-name>ProjectSelect</servlet-name>
<servlet-class>MyProject.Login.ProjectSelect</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ProjectSelect</servlet-name>
<url-pattern>/ProjectSelect.do</url-pattern>
</servlet-mapping>
But what would the servlet mapping have to do with the doGet
and doPost
?
Kind regards,
B.