tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric H." <ehara...@usc.edu>
Subject Re: ServletContext.setAttribute()
Date Fri, 14 Jul 2000 22:59:43 GMT
Where did you get the RequestDispatcher?
Did you do something like:

(where request is the HttpServletRequest sent to your servlet and
 response is the HttpServletResponse)

RequestDispatcher rd=request.getRequestDispatcher("../path/some.jsp");
rd.forward(request,response);

On Fri, 14 Jul 2000, Jeremy Linzer wrote:

> Hi all,
> 
> I am pretty new to this and I have what maybe a simple question. I wrote
> a simple Servlet (passes a message to a JSP and JSP outputs it). It
> compiles fine but when I try accessing it I got a 500 error:
> 
> java.lang.NullPointerException:
>         at HelloWorldServlet.service(HelloWorldServlet.java:14)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at
> org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503)
> 
>         at
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
>         at
> org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:160)
> 
>         at
> org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338)
> 
>         at java.lang.Thread.run(Thread.java)
> 
> line 14 that it refers to in the servlet is rd.forward(req, res);
> rd is of type RequestDispatcher
> 
> If anyone has any ideas or suggestions I would really appreciate it.
> 
> THanks,
> Jeremy
> 
> 
> 

-Eric Harashevsky, USC ISD Student Consultant


Mime
View raw message