Vankina Venkateswara Rao wrote:
>
> Hi Gurus,
>  I am doing an appliation in which I will download the applet and after entering the 
>userID & Password it should invoke a servlet on the  server from which it is 
>downloaded ,which  inturn should invoke four different servlets residing on four 
>webservers to validate the  userID & Password.
>
>  can any body give me some addresses where  I can get the code for inter servlet 
>communication between two servlets residing on two different servers  .

Thank Sun for stream-oriented I/O it seems you shouldn't have any
problem. What you do is prepare each servlet to read and write and
that's it! If you can sustain serialization (=same JVM) I would suggest
you do it like that. Get the 'gatekeeper' servlet pass along the
credentials with a GET (I assume this is the way the applet contacts the
first servlet originally, so you know how to do this) and be prepared to
catch their output (remember, your applet, not your browser, is now an
HTTP client to your servlet and your 'gatekeeper' servlet is now an HTTP
client to the eyes  of the validating servlets). You parse the
(possibly) HTML they return you and you are done. You can try
multi-threading but I am not guru enough to say in this case if this is
a better approach in the long run, compared to serial querying of the
servlets, which implies breaking early if one of your validators
bounces.

It would be interesting to explore if you can do it with HTTP level
redirects, that is passing along the original GET from the applet...
Right now, I cannot think why you couldn't.

Ample of source code exists in places like www.servlets.com which would
give you links to yet more code snippets (even for a redirect
implementation). BTW, if you need to move around lots of stuff (unlikely
in your case) and you cannot do GET, see an old article at Javaworld for
how to tweak with POST.

Have fun (millennium, trillennium, or otherwise:-)
Kostas


>   Thanks in advance.
> Cheers,
> Venkat.
>
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to