Hi, Ben:
Thanks for your inputs.
1. How can I redirect post data to server2?
2. How can I store the entire original HttpServletRequest (on server 1) into a
distributed HttpSession? Aren't they still on server1? Or, Are you suggesting me to
use RMI?
3. What do you mean by make a container class for all data?
Sorry, I don't have much experience on Java Servlet. Some sample codes will help me a
lot.
Thanks,
Jackie
----------
From: Ben Engber[SMTP:[EMAIL PROTECTED]]
Sent: Monday, May 10, 1999 11:58 AM
To: [EMAIL PROTECTED]
Subject: Re: Need some inputs
I can think of two solutions to your problem:
The easiest solution is to make a servlet (or CGI, etc) on server 1 which
gets the request, transforms the POST data to GET data, and performs a
redirect to server 2. The problem here is that sending large amounts of
data as a GET is probably not a good idea, and if your servlets on server 2
rely on cookies or other non-form data, you'll have a problem.
A more complete solution would be to store the entire original
HttpServletRequest (on server 1) into a distributed HttpSession. Then the
servlet on server 2 could use the request from the session instead of the
"true" request and would behave as if it received it directly. One thing
to note is that if the HttpServletRequest implementation is not
Serializable, you'll have to make a container class for all the data. I
have used this approach by making a SerializableHttpServletRequest class
and passing that to the session. It has worked so far for me.
-Ben
At 10:23 AM 5/10/99 -0700, you wrote:
>Hi:
>I need your inputs on if there is a way to work around the following
problem. Currently, I have my servlet programs running on server1 with
IP1, and I plan to move those servlets to server2 with IP2; however, all of
my client programs are posting data to the servlets on IP1. I can't
change mt client programs to point to IP2.
>
>How can I map or redirect those servlets from server1 to server2? In
other words, How can I make the following mechanism work? Client send
requests to server1, servlets on server1 will forward client's requests to
servlets on server2, and servlets on server2 send back the response to
client. I try servlet redirect and set servlet alias, but none of them
would solve the problem.
>
>Thanks in advance,
> Jackie
>
>___________________________________________________________________________
>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
--
Ben Engber
Software Engineer
The New York Times
[EMAIL PROTECTED]
___________________________________________________________________________
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
___________________________________________________________________________
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