• Post Reply Bookmark Topic Watch Topic
  • New Topic

Named Dispatcher Issue

 
Reema Patel
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I'm trying to use a named dispatcher and then forwarding the request to that resource. Here is the web.xml

And, here is the servlet code:
RequestDispatcher view=getServletContext().getNamedDispatcher("/init");
if(view!=null)
view.forward(request,response);
System.out.println("**doing forward**"+view);
When I try to run the same I get a blank page and null is printed on the console....pls help...
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The name of the method should give you a hint. You're using getNamedDispatcher, so you should pass the name of a servlet, not a path. In your case, the name is "list".
 
Durgaprasad
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use the name of the servlet whihc is declared within the servlet name tag. it will work fine
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!