Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inter servlet communication

 
Kash Mhai
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Amol Nayak
Ranch Hand
Posts: 218
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Kash Mhai
Greenhorn
Posts: 29
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic