Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2007

Tip: Looking for answers? Try searching our database.

Servlets - Invoke Remote Servlet

Thread view: 
spacerobots@gmail.com - 30 Apr 2007 18:09 GMT
Hi,

I'm writing two servlets, and I would like one to call the other.
Each one will reside on seperate machines.

Let's call them servlet1 and servlet2.  servlet1 needs to pass a file
to servlet2.  So I'd like to call up servlet2's doPost method and pass
in the file that way.  Then when servlet2 is finished doing its work,
it needs to pass back a different file that it has created.  So I'm
thinking I would just dump the return file into the response and that
would come back to servlet1.  Is that the most sensible way to do it?
If not, please enlighten me!  If so, can anybody point me in the right
direction with code examples?  How can I put in a URL in my java code
and call that URL?

Thanks in advance,
-Ryan
Robert Mark Bram - 01 May 2007 01:36 GMT
Hi Ryan,

> I'm writing two servlets, and I would like one to call the other.
> Each one will reside on seperate machines.
[quoted text clipped - 8 lines]
> direction with code examples?  How can I put in a URL in my java code
> and call that URL?

Perhaps you want a forward, something like this:
http://www.stardeveloper.com/articles/display.html?article=2001062401&page=1

Do they need to be servlets? I.e. do you need to start the process off
from a browser? If not, you could use RMI instead and have remote
objects calling each other.

Rob
:)


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.