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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Inter servlet communication" Watch "Inter servlet communication" New topic
Author

Inter servlet communication

Kash Mhai
Greenhorn

Joined: Apr 01, 2005
Posts: 29
Hi,
I have a small issue with the servlets. I have two servlets which need to communicate to each other. But both of them are in different applications on different servers (Websphere) Is there a way in which these can communicate to each other? I need to pass all request attributes/parameters of one servlet to be available to the other servlet in another application? I thought of appending stuff to URL, but thats ruled out. Am not sure RequestDispatcher would work too...!

Any ideas?
Thanks
Kash


-------------<br />There are wheels within wheels...<br />P.G Wodehouse
Amol Nayak
Ranch Hand

Joined: Oct 26, 2006
Posts: 218
I dont think there is anything in the javax.servlet package to help you out in this.
You can use some other api to create a new request and post the data (parameters and attributres) as parameters to the second servlet.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

You're correct.
RequestDispatcher will not work.

This question gets asked a lot here so searching this forum should bring up a lot of information.
There are several ways for applications to communicate with one another.
The best depends on your details.

For simple communication, you could use java.net.URLConnection or
the httpClient at http://jakarta.apache.org/commons/httpclient.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Kash Mhai
Greenhorn

Joined: Apr 01, 2005
Posts: 29
Thanks Ben,
I knew this was a frequently asked question, but i was not able to frame the exact text for framing the question. Maybe i'll start off with HttpClient

Thanks,
 
Don't get me started about those stupid light bulbs.
 
subject: Inter servlet communication
 
Similar Threads
Communication Between 2 Action Classes
generating security tokens in servlets
servlet/JSP communication?
is it possible to distribute a servlet based application?
Doubts about Servlets and JSP(Please explain all my doubts with examples clearly)