Hans,
Thanks for pointing that out.
David,
If in fact you are using Java Web Server, do you also
notice that this problem on occurs when the web server
has to compile the jsp THE FIRST TIME? If this is the
behavior you are observing, then it is the bug that I
was referring to. The workaround is to precompile the
jsp files, or directly hit those pages directly first
to force the web server to compile them.
Hope this helps,
Kachana
--- Hans Bergsten <[EMAIL PROTECTED]> wrote:
> Kachana Ung wrote:
> >
> > David,
> >
> > I ran into this very same problem. I was later
> told
> > that it is a bug in Java Web Server 2.0. Don't
> know
> > if this the web server you are using.
>
> I'm not saying that JWS 2.0 is bug free, but in this
> case the problem is
> more likely caused by a bug in the servlet code. The
> NullPointerException
> is thrown because getRequestDispatcher() returns
> null, so the rd
> variable doesn't have a value. That will happen in
> any servlet container.
>
> The reason getRequestDispatcher() returns null is
> likely because the
> path used as an argument is invalid. It must start
> with a slash (/) and
> is a context-relative path (i.e. the path *without*
> the URI prefix assigned
> to the context).
>
> For more on this, search the archives and read the
> Servlet specification.
>
> Hans
> > --- David Reck
> <[EMAIL PROTECTED]>
> > wrote:
> > > I have the following code:
> > >
> > > RequestDispatcher rd =
> > >
> >
>
getServletContext().getRequestDispatcher("/servlet/testServlet");
> > > rd.forward(request, response);
> > >
> > > The code works when I forward to a servlet but
> the
> > > code does not work when I try
> > > to forward to a jsp page or a html page. I get
> a
> > > java.lang.NullPointerException
> > > with jsp's and html's. Is there anything
> different
> > > that needs to be done when
> > > forward to something other than a servlet.
> > >
> > > Any suggestions would be greatly appreciated.
> > >
> > > Thanks,
> > >
> > > Dave
>
> --
> Hans Bergsten [EMAIL PROTECTED]
> Gefion Software
> http://www.gefionsoftware.com
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with
> body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
__________________________________________________
Do You Yahoo!?
Yahoo! Mail � Free email you can access from anywhere!
http://mail.yahoo.com/
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets