• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inter Servlet Communication

 
raj lakshmi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everybody,
Here I am facing problem in forwarding my request to Servlet from another Servlet.
Here is the code I used.........
/////
RequestDispatcher dispatcher = request.getRequestDispatcher("/servlets/myserv");
dispatcher.forward(request,response);
//////
Here I am facing error that it is not recognising the resource not allowed HTTP 405.
Even i removed the PrintWriter Implementation part in the servlet from where I am forwarding request to..........
I would be very happy if anyone could solve my problem........
cheers,
rajalakshmi_ravva@javaranch.com
rajalakshmi_ravva@rediffmail.com
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you tell us which app/web server you are using?
rajalakshmi_ravva@javaranch.com
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it is because when you use the "servlet/someservlet" nomenclature, the actual execution goes through the invoker servlet, your servlet is not really part of the "web application" as far as the request dispatcher is concerned.
Bite the bullet - learn how to define servlets in web.xml and NEVER use the /servlet/ approach again! It just causes endless trouble.
Bill
 
raj lakshmi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pradeep Bhat:
Can you tell us which app/web server you are using?
rajalakshmi_ravva@javaranch.com

Thank u for ur reply.
I am using Pramati Server.
cheers,
rajalakshmi
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just read Pramati server docs.
Why are using "/servlets/.." in request dispatcher. Remove that. Just give
RequestDispatcher dispatcher = request.getRequestDispatcher("/myserv");
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic