aspose file tools*
The moose likes Servlets and the fly likes Inter Servlet Communication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Inter Servlet Communication" Watch "Inter Servlet Communication" New topic
Author

Inter Servlet Communication

raj lakshmi
Greenhorn

Joined: Sep 03, 2003
Posts: 7
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

Joined: Feb 27, 2002
Posts: 8919

Can you tell us which app/web server you are using?
rajalakshmi_ravva@javaranch.com


Groovy
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12825
    
    5
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

Joined: Sep 03, 2003
Posts: 7
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

Joined: Feb 27, 2002
Posts: 8919

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
 
subject: Inter Servlet Communication