• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Inter Servlet Communication

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 8944
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you tell us which app/web server you are using?
rajalakshmi_ravva@javaranch.com
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 8944
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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");
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic