tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shahed Ali" <>
Subject getRequestDispatcher() does not return null
Date Thu, 01 Feb 2001 14:36:07 GMT

I am using Tomcat 3.2.1 w/JSK 1.3 on Intel Solaris w/Apache 1.3.14

I have he following fragment of code.

 RequestDispatcher rd = request.getRequestDispatcher(routeto);

        if(rd != null)
            System.err.println("Error : Cannot get Request Dispatcher");

According to the 2.2 JavaDoc

Returns a RequestDispatcher object that acts as a wrapper for the resource
located at the given path.
A RequestDispatcher object can be used to forward a request to the resource
or to include the resource in a response.
The resource can be dynamic or static.
The pathname specified may be relative, although it cannot extend outside
the current servlet context.
If the path begins with a "/" it is interpreted as relative to the current
context root.
This method returns null if the servlet container cannot return a

Now , my resource in the routeto variable points to a non existant jsp page.
However, I dont get a null.
The JavaDoc is a bit misleading. How can I determine if the resource exists
or not ?


View raw message