I had changed my code,dispatcher doesn't return null, but it still give
me error information.

500 Internal Server Error
com.livesoftware.jsp.JSPServlet:
javax.servlet.ServletException: The page '/hello.jsp' does not exist.

My hello.jsp and  serlvet are  in the same directory,anyone has
experience to resolve it
Thanks
Craig R. McClanahan �g�D�G

> There are two issues:
>
> * According to the API documentation, the argument to
> getRequestDispatcher
>   needs to start with a slash, and be interpreted as relative to the
> servlet
>   context your app is running in.  Try this instead:
>
>     dispatcher =
> getServletContext().getRequestDispatcher("/SearchResult.jsp");
>
> * According to the API documentation, getRequestDispatcher() is
> allowed to
>   return null.  However, your code does not check for this case, so
> the NPE
>   is your code's fault.  Try this instead:
>
>     if (dispatcher != null) {
>         dispatcher.include(req, res);
>     } else {
>         ... report the error, or ignore, as appropriate ...
>     }
>
> I don't use JRun, so there might be other JRun specific issues as
> well, but you need
> to address these two.
>
> Craig McClanahan

___________________________________________________________________________
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

Reply via email to