Re: The Joy of File : New Window

2001-04-12 Thread Wyn Easton

Welcome to the world of web programming ;-

I had the same problem a while back.
What we did was create a "key" for each new logon.
By logon I mean that requests always came to one
servlet before going to other servlets or JSPs.
This "main" servlet would generate a unique key and
pass it to other servlets or JSPs in the request
as an attribute. (request.setAttribute("sessionKey",
theKey);) We used the Date() method to get a unique
key. The JSPs would always store this key in a hidden
variable in the form it sends back to the web server.
We stored the bean for this request in the session
using the key (session.setAttribute(key,theBean);
Then when a another request came in we first get the
key from the request (String theKey =
requesst.getParameter("mySessionKey");) then get the
bean for the request (session.getAttribute(theKey);)

For this to work you must not call getSession(true)
except in the "main" servlet. All other servlets
should use getSession(false);  then check for a null
return.
If it is null, send the request to the "main" servlet.




--- Erik Horstkotte [EMAIL PROTECTED] wrote:
 I've run into a problem that seems to lie in the
 borders between Struts
 and Tomcat. We're developing a fairly large JSP 
 EJB - based project
 and have just run into the fun fact that when a user
 (of IE 5.5 or
 Communicator 4.61 at least) "splits" the window, the
 session id cookie
 is inherited by the new window, and therefore *both*
 windows start
 sharing the same form beans. This causes havoc. I
 don't see how our app
 can even *detect* the condition, much less *deal*
 with it.
 
 How are you others out there dealing with this
 issue?
 
 -- Erik
 
 


__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/



The Joy of File : New Window

2001-04-10 Thread Erik Horstkotte

I've run into a problem that seems to lie in the borders between Struts
and Tomcat. We're developing a fairly large JSP  EJB - based project
and have just run into the fun fact that when a user (of IE 5.5 or
Communicator 4.61 at least) "splits" the window, the session id cookie
is inherited by the new window, and therefore *both* windows start
sharing the same form beans. This causes havoc. I don't see how our app
can even *detect* the condition, much less *deal* with it.

How are you others out there dealing with this issue?

-- Erik