Posted By:
Douglas_Michael
Posted On:
Wednesday, January 16, 2002 09:39 AM
I have a jsp file (index.jsp) in the contacts/ directory calling a servlet called search.java. search.java calls the target update.jsp. When I post from update.jsp, it calls update.java and everything works fine. However, when I attempt to get back to the original index.jsp to start over again my URL has changed to the servlet directory. When I attempt to go back to the path that I started from, in order to execute the index.jsp page, it can't call my servlets. Inside my servlets, after they are done executing, I am attempting to forward the request to the target like so: public String target="/contacts/index.jsp"; // Forward the request to the target named Serv
More>>
I have a jsp file (index.jsp) in the contacts/ directory calling a servlet called search.java.
search.java calls the target update.jsp.
When I post from update.jsp, it calls update.java and everything works fine. However, when I attempt to get back to the original index.jsp to start over again my URL has changed to the servlet directory. When I attempt to go back to the path that I started from, in order to execute the index.jsp page, it can't call my servlets.
Inside my servlets, after they are done executing, I am attempting to forward the request to the target like so:
public String target="/contacts/index.jsp";
// Forward the request to the target named
ServletContext context = getServletContext();
System.err.println("Redirecting to " + target);
RequestDispatcher dispatcher = context.getRequestDispatcher(target);
dispatcher.forward(request, response);
What am I doing wrong?
Thanks
Doug
<<Less