servlet forwarding

Hello

I wan't to call a servlet out from a servlet.

I used the commands:

HttpServletResponse response=null;

response.sendRedirect("/servlet/search");

then the servlet will not be found.

I tried also the following command:

RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/servlet/search31");

then it displayed the following error message:

java.lang.NoSuchMethodError: javax.servlet.ServletContext: method getRequestDispatcher(Ljava/lang/String;)Ljavax/servlet/RequestDispatcher

This error message occures because I have an old api 2.0. But I have not found any updates to API 2.1 on novell support pages. Maybe there is no update.

Have you an idea, how I can load a servlet with another way? But I should give a session id to the second servlet. And the second servlet should use the id too.

I thank you for your help.

Sandra Frei

[952 byte] By [sfrei] at [2007-9-26 23:11:37]
# 1
Don't know if this will help but here is how I forward to a jsp.getServletConfig().getServletContext).getRequestDispatcher("admin/results.jsp").forward(request, response);
Ydassac at 2007-7-4 12:07:24 > top of Java-index,Archived Forums,New To Java Technology Archive...