| Author |
post to a different system's servlet
|
Kishore Dandu
Ranch Hand
Joined: Jul 10, 2001
Posts: 1934
|
|
If I am posting from a servlet on my domain to a different domain's Servlet; what is the method that needs to be used. Is it response.redirect or forward that needs tobe used.
|
Kishore
SCJP, blog
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56179
|
|
|
Neither will allow you to access a foriegn servlet.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Kishore Dandu
Ranch Hand
Joined: Jul 10, 2001
Posts: 1934
|
|
|
then what is the method for invoking a foreign servlet from ur servlet.
|
 |
Ajith Anand
Ranch Hand
Joined: Aug 30, 2004
Posts: 40
|
|
|
You may use a java.net.HttpURLConnection to do the Post....
|
LXI Technologies P Ltd
[url]www.lxisoft.com[/url]
|
 |
Kishore Dandu
Ranch Hand
Joined: Jul 10, 2001
Posts: 1934
|
|
There should be other easier way to do this. HppUrlConnection is not very reliable(it can lock ur threads and need extra programming to take care of releasing the threads) and is bi-directional, which is not necessary in cases.
|
 |
Ajith Anand
Ranch Hand
Joined: Aug 30, 2004
Posts: 40
|
|
Originally posted by Kishore Dandu: There should be other easier way to do this. HppUrlConnection is not very reliable(it can lock ur threads and need extra programming to take care of releasing the threads) and is bi-directional, which is not necessary in cases.
In what sense is not reliable ??? I dont understand about the threads that you are talking about...locking and releasing ??? I dont think there is another way to do a post from one servlet to another....
|
 |
Kishore Dandu
Ranch Hand
Joined: Jul 10, 2001
Posts: 1934
|
|
Originally posted by Ajith Anand: In what sense is not reliable ??? I dont understand about the threads that you are talking about...locking and releasing ??? I dont think there is another way to do a post from one servlet to another....
What i mean is, there is no effective timeout mechanism when u are using Httpurlconnection. It will holdup ur process that is trying to use it(that is what I meant by thread).
|
 |
Ajith Anand
Ranch Hand
Joined: Aug 30, 2004
Posts: 40
|
|
|
Jakarta commons httpclient would be an option...if you are keen on timeouts..etc
|
 |
Jeroen Wenting
Ranch Hand
Joined: Oct 12, 2000
Posts: 5093
|
|
Originally posted by Kishore Dandu: What i mean is, there is no effective timeout mechanism when u are using Httpurlconnection. It will holdup ur process that is trying to use it(that is what I meant by thread).
that's not a problem in the HttpUrlConnection but rather in the way you use it.
|
42
|
 |
Kishore Dandu
Ranch Hand
Joined: Jul 10, 2001
Posts: 1934
|
|
Originally posted by Jeroen Wenting: that's not a problem in the HttpUrlConnection but rather in the way you use it.
can u elaborate on this?
|
 |
 |
|
|
subject: post to a different system's servlet
|
|
|