getRequestDispatcher("hello.jsp") is probably returning null.
Try getRequestDispatcher("\hello.jsp") if hello.jsp is in the root
directory,
Kevin
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
Khurram Saqlain
Sent: 07 January 2000 00:23
To: [EMAIL PROTECTED]
Subject: calling JSP page from servlet
Hello,
I just installed the JDK, J2EE and iPlanet 4.0 on
a Solaris box.
I'm trying to call a JSP page from my servlet to
be streamed back to the client. The problem is
that the servlet keeps throwing an exception when
I call the JSP page.
My servlet code:
public void doGet(HttpServletRequest request,
HttpServletResponse response) throws IOException
{
PrintWriter out = response.getWriter();
response.setContentType("text/html");
try
{
getServletContext().getRequestDispatcher("hello.jsp").forward(
request, response);
}
catch (Exception ex)
{
ex.printStackTrace();
}
}
I have placed hello.jsp into the document root. The
exception being thrown:
javax.servlet.ServletException: RequestDispatcher:
forward call failed at
com.netscape.server.http.servlet.NSRequestDispatcher.forward(NSReques
tDispatcher.java, Compiled Code)
at servlet1.doGet(servlet1.java, Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java,
Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java,
Compiled Code) at
com.netscape.server.http.servlet.NSServletRunner.Service(NSServletRun
ner.java, Compiled Code)
I placed the .class file for this servlet in my servlets
directory that I specified in iPlanet 4.0. I also enabled
JSP in the web server.
Any suggestions would be appreciated.
thanks,
Khurram
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html