I would like to create a .jsp page that is to be loaded on pageload, but the content of the page is dynamically created by calling my local database.
My question is. When a user request the index.jsp page, how do i "say". Before displaying the index.jsp page call servletX to get content, and send this back to the index.jsp page?
I have mapping my jsp and servlet together as follows
<servlet>
<servlet-name>intname</servlet-name>
<servlet-class>ServletBooks</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>intname</servlet-name>
<url-pattern>/index.jsp</url-pattern>
</servlet-mapping>
But dont know how i send the dispather, back to self? getServletContext().getRequestDispatcher(???).forward(request, response);
Edit. Okey so now the site works as follows. I request the index.jsp page, which is mapped in the web.xml to a servlet. But if i set the requestDispatcher to the index.jsp page, the whole site hangs. If i set it to another page like result1.jsp it works fine. Execpt it isint the index page displaying the content.
How do i say to the servlet, send output to initiator?