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

Servlet Calling?

Kaustubh G Sharma
Ranch Hand

Joined: May 13, 2010
Posts: 1281

Ways to call a servlet from another servlet??


No Kaustubh No Fun, Know Kaustubh Know Fun..
vijin das
Ranch Hand

Joined: Jun 07, 2010
Posts: 129

What is your exact requirement ??

if you want to implement any functionality you can make it in separate class and can compose it in your servlet ...

what type of advantage you need by calling a servlet from another one ....

or you need servlet chaining if that is the case then check this ...

servlet-chaining

VIJINDAS
Kaustubh G Sharma
Ranch Hand

Joined: May 13, 2010
Posts: 1281

just want to know the ways to invoke an servlet from another...
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12821
    
    5
The most obvious way is to have the first servlet compose a URL and make a connection using the standard Java library methods as if it was a browser. See java.net.HttpURLConnection and related classes.

Your question is missing all the details which might permit a better answer. For instance, are both servlets housed on the same container?

Bill
Kaustubh G Sharma
Ranch Hand

Joined: May 13, 2010
Posts: 1281



William:-Your question is missing all the details which might permit a better answer


william will you please let me know what is missing in my question so that I'll get some better answer for it...

Thanks
Kaustubh
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10262
    
168

Bill already mentioned one of the details that missing in your question. And that's just a start. You haven't told us anything about why you want to call a servlet from another servlet? One liner questions usually don't get any useful answers because it forces the readers to do the guess work.


[My Blog] [JavaRanch Journal]
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

That is why we encourage ranchers to TellTheDetails.


[My Blog]
All roads lead to JavaRanch
Kaustubh G Sharma
Ranch Hand

Joined: May 13, 2010
Posts: 1281



Jaikiran Pai :-You haven't told us anything about why you want to call a servlet from another servlet?


I got this query from one of my friend and that time I was not able to explain it fully....

kaustubh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet Calling?