Chris et al, thanks ever so much for all the great help. I finally got
things working. This has been quite an educational experience for me. I am
appending to this message my complete *WORKING* servlet.
Having gotten this far, my next question is this: Is there any way that I
can get this to work within the context of a jsp? Say for example that I
call a method from within a JSP and that method could through an exception.
I have a catch block to handle the exception. What I'd like to do is to
jump (on the occurrence of an exception) from the jsp that has the
method-throwing exception to a different error-handling jsp. Is there a way
that I can do that?
Again, thanks to all.
... doug
/* WORKING SERVLET */
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Test2 extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head><title>Test 2</title></head>");
out.println("<body>");
out.println("<p>Hello, world!</p>");
if (request.getParameter("jump") != null )
{
request.getRequestDispatcher(request.getParameter("jump")).forward(request,
response);
}
out.println("</body>");
out.println("</html>");
}
}