It's not a secret anymore!*
The moose likes Servlets and the fly likes Calling a servlet within a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Calling a servlet within a servlet" Watch "Calling a servlet within a servlet" New topic
Author

Calling a servlet within a servlet

Steve Lam
Greenhorn

Joined: Aug 03, 2001
Posts: 5

Is there a way to call a servlet within another servlet?
Thanks a lot!
PS. Both servlets reside on the same system
Terence Doyle
Ranch Hand

Joined: May 30, 2001
Posts: 328
HI,
Yes. You can use a RequestDispatcher.
I'm not sure of the exact syntax so I'll let some other good soul volunteer that
Meanwhile I'll search the net for an example.....
Bye,
------------------
Terry Doyle
Sun Certified Programmer for Java 2 Platform


Raising Flares debut album 'Ignition' out now

http://www.raisingflares.com

Terry Doyle <br />SCPJ 1.4 , SCWCD , SCMAD(Beta)
Terence Doyle
Ranch Hand

Joined: May 30, 2001
Posts: 328
Found one!!
http://java.sun.com/docs/books/tutorial/servlets/communication/request-dispatcher.html

Hope that helps,
------------------
Terry Doyle
Sun Certified Programmer for Java 2 Platform
Steve Lam
Greenhorn

Joined: Aug 03, 2001
Posts: 5
Thanks!!!
 
Don't get me started about those stupid light bulbs.
 
subject: Calling a servlet within a servlet