This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 8903

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: 41035
    
  43
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to call one servlet from other servlet
 
Similar Threads
validation in servlet for jsp form
Dependatable fields on
Midlet problem! Any help appreciated.
j2me servlet communication
drawing graphs