-
Redirecting a session to another server
How does one redirect a session on one web server (computer A) to another
web server (computer B) and retain all of the session information, like a
Bean that has been instantiated (on computer A) and has session scope, etc.
-
Re: Redirecting a session to another server
In article <399a9797$1@news.devx.com>,
Carl Crosswhite <Carlxw@ix.netcom.com> wrote:
>
>How does one redirect a session on one web server (computer A) to another
>web server (computer B) and retain all of the session information, like a
>Bean that has been instantiated (on computer A) and has session scope, etc.
There's nothing in the JSP specification that allows for this,
unfortunately. However, there are a few ways you could go about it.
If both computers have access to some database, A could store all the
session information into a table before the redirect, and then a
servlet or JSP on B could retrieve the data and use it to rebuild the
session. You would also need to pass some sort of ID in the redirect,
so that B would know which data to retrieve.
Alternately, you might be able to pass all the session information
through the query string when you do the redirect. This would be
pretty easy to implement if everything in the session is simple data
like ints and strings. If you are storing a lot of objects in the
session, this gets messier.
Some application servers may provide functionality behind the base JSP
spec. I think ATG's "Session Federation" allows data to be shared
between applications running on different machines.
- Larne
-
Re: Redirecting a session to another server
Yes you can do it with ATG Dynamo. There is also a very good feature that
sends your session data to a second server if the first goes down for any
reason.
Fernando Ribeiro
fribeiro@bol.com.br
larnep@canetoad.canetoad.com (Larne Pekowsky) wrote:
>In article <399a9797$1@news.devx.com>,
>Carl Crosswhite <Carlxw@ix.netcom.com> wrote:
>>
>>How does one redirect a session on one web server (computer A) to another
>>web server (computer B) and retain all of the session information, like
a
>>Bean that has been instantiated (on computer A) and has session scope,
etc.
>
>There's nothing in the JSP specification that allows for this,
>unfortunately. However, there are a few ways you could go about it.
>
>If both computers have access to some database, A could store all the
>session information into a table before the redirect, and then a
>servlet or JSP on B could retrieve the data and use it to rebuild the
>session. You would also need to pass some sort of ID in the redirect,
>so that B would know which data to retrieve.
>
>Alternately, you might be able to pass all the session information
>through the query string when you do the redirect. This would be
>pretty easy to implement if everything in the session is simple data
>like ints and strings. If you are storing a lot of objects in the
>session, this gets messier.
>
>Some application servers may provide functionality behind the base JSP
>spec. I think ATG's "Session Federation" allows data to be shared
>between applications running on different machines.
>
> - Larne
-
Re: Redirecting a session to another server
What about serializing the session object and passing it on? [Using sockets,
or using servlets themselves:binay streams?]
-
Re: Redirecting a session to another server
In article <399cce92$1@news.devx.com>, Ashutosh Narhari <none@none.com> wrote:
>
>What about serializing the session object and passing it on? [Using sockets,
>or using servlets themselves:binay streams?]
Hmmm, that's clever. You would have to make sure that the session
gets to the second machine before the user does, but that shouldn't be
too hard to arrange. And you would still need some way to attach the
user to the session once they get to the second machine, but all you'd
need here is an ID.
- Larne
Similar Threads
-
By rperez in forum Database
Replies: 5
Last Post: 01-02-2009, 05:14 PM
-
By Andy H in forum Database
Replies: 8
Last Post: 10-04-2005, 01:27 AM
-
By Nate in forum Database
Replies: 29
Last Post: 05-09-2001, 10:04 AM
-
By Levi Nkata in forum Database
Replies: 3
Last Post: 04-11-2001, 09:31 AM
-
By sajid in forum Enterprise
Replies: 4
Last Post: 12-10-2000, 04:15 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|