aspose file tools*
The moose likes Servlets and the fly likes how to call one servlet from other servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to call one servlet from other servlet" Watch "how to call one servlet from other servlet" New topic
Author

how to call one servlet from other servlet

jaspal singh
Ranch Hand

Joined: Sep 15, 2005
Posts: 54
there is one servlet runnin in the application which gets some data and
send to another servlet to process it and return that data back.

so how do i do this...


thanxz in advance





[BS: removed "urgent" from the subject]
[ January 17, 2006: Message edited by: Ben Souther ]

Teach me the art of forgetting, for I always remember wat I have forgotten.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

You can make use of ServletRequestDispatcher to forward request to the 2nd servlet.
http://home.earthlink.net/~alxdark/software/wcd-guide/ch01s06.html


Groovy
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

jaspal,

Please read the following page to find out why putting "urgent" in your subject heading will actually slow down responses to your question:
http://faq.javaranch.com/view?EaseUp


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41806
    
  62
A better design might be to refactor the other servlet so that you can instantiate it as a class, and then call the methods of that class, instead of trying to pass parameters and get results the HTTP way, when it is should be a local call.


Ping & DNS - my free Android networking tools app
jaspal singh
Ranch Hand

Joined: Sep 15, 2005
Posts: 54
Please read the following page to find out why putting "urgent" in your subject heading will actually slow down responses to your question:


oh! big sorry for that.

thanx for getting me aware of the fact.
 
wood burning stoves
 
subject: how to call one servlet from other servlet