This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inter Servlet Communication

 
raj lakshmi
Greenhorn
Posts: 7
  • 0
  • 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
  • 0
  • 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: 13047
6
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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");
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic