• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet Calling?

 
Kaustubh G Sharma
Ranch Hand
Posts: 1283
Chrome Java Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ways to call a servlet from another servlet??
 
vijin das
Ranch Hand
Posts: 129
Firefox Browser Java Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Kaustubh G Sharma
Ranch Hand
Posts: 1283
Chrome Java Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
just want to know the ways to invoke an servlet from another...
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13045
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1283
Chrome Java Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is why we encourage ranchers to TellTheDetails.
 
Kaustubh G Sharma
Ranch Hand
Posts: 1283
Chrome Java Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic