http request directed to 2nd server
We are developing a sevlet SSO application on Spring platform, composing
of a client and 2 servers. We want to access the 2nd server by showing its
web page with only loging in to the 1st server, by passing a specific Http
request with user info in its customized header from the 1st server to the
2nd one.
Currently we have 2 issues:
"HttpClient" to fetch a web page It seems that the easiest way is to
implement the "HttpClient" class (though I am new to it), and indeed this
works to set up the communication with the 2nd server by acknowledging the
specific header from 2nd server. However, "HttpClient" could only extract
the HTML/XML info from the 3rd server without displaying any web page to
the browser. Can anyone advice me on this issue by returning a normal web
page?
Both "redirect" and "forward" fail To circumvent the first issue, we try
other class/interface as well. First, we try "forward" but instantly
realised it won't work because the 2nd server is in different context.
Then we try the "redirect" but this also won't work because "redirect"
will instruct the browser to send a new Http request and the formatted
Http header (including the user info) will be lost. So both ways fail.
Anyone can suggest better solution to this?
Thanks, Charlie
No comments:
Post a Comment