requestDispatcher doesn't work
843840May 28 2002 — edited May 30 2002I want to generate html from within a servlet. Pieces of this code are static and I've put them into html-source pages. The final web-page should be created using this source-pages and result of java-coding (db info). The sources do exist, the paths are correct. I know I could replace the servlet by JSP but I don't want to do this. Who can give me a hint why this piece of code doesn't work?
try
{
RequestDispatcher dispatcher = getServletConfig().getServletContext().getRequestDispatcher("/ContiLines/ssi/VesselSchedule/Header.html");
dispatcher.include(req,res);
dispatcher = getServletConfig().getServletContext().getRequestDispatcher("/ContiLines/ssi/VesselSchedule/Body.html");
dispatcher.include(req,res);
dispatcher.forward(req,res);
}
catch (ServletException e)
{
System.out.println("problems with SDisplayHtmlTest-servlet");
e.printStackTrace();
}
I always get a blank screen in the browser and the WAS-loggings tell me the following:
std-out
----------
[02.05.28 09:50:15:390 GMT+02:00] a6c31083 ServletInstan A SRVE0048I: Loading servlet: "svesselschedule.SDisplayHtmlTest"
[02.05.28 09:50:15:530 GMT+02:00] a6c31083 WebGroup A SRVE0091I: [Servlet LOG]: "svesselschedule.SDisplayHtmlTest: init"
Servlet SDisplayHtml intializing...
[02.05.28 09:50:15:560 GMT+02:00] a6c31083 ServletInstan A SRVE0130I: Servlet available for service: "svesselschedule.SDisplayHtmlTest"
[02.05.28 09:50:15:621 GMT+02:00] a6c31083 ServletInstan A SRVE0130I: Servlet available for service: "svesselschedule.SDisplayHtmlTest"
problems with SDisplayHtmlTest-servlet
std-err
----------
com.ibm.servlet.engine.webapp.NoTargetForURIException: No target servlet configured for uri: /ContiLines/ssi/VesselSchedule/Header.html
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcherInfo.getTargetServlet(WebAppRequestDispatcherInfo.java:104)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:486)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:290)
at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:198)
at svesselschedule.SDisplayHtmlTest.doGet(SDisplayHtmlTest.java:49)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
...
...
Patrick Goovaerts
ICT/Clipper Support nv
...
...