Problem in call to RequestDispatcher.include() method
Joined: Jul 31, 2006
Can any one solve the following error asap.
When I obtained RequestDispatcher object with following code I get following exception
type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception java.lang.IllegalArgumentException: Path does not start with a "/" character com.Production.sdc.servStyleSample.service(servStyleSample.java:352) javax.servlet.http.HttpServlet.service(HttpServlet.java:856) note The full stack trace of the root cause is available in the Tomcat logs.
Code written :
ServletContext sc = getServletContext(); RequestDispatcher rd = sc.getRequestDispatcher("/exists.jsp?formnm=create_stylesample.jsp&chksts=Exists"); // this line generate error rd.include(req, res);
"/" was included right from beginning , as per language requirement "/" must be included to obtained relative path while getting RequestDispatcher object.Earlier I am not getting such kind of error , can any one find out more. Servlet is recompiled and loaded through Tomcat Manager , reload option available .Also where can I find out context path set for application in NetBeans IDE 3.6 and Tomcat environment.