tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike W-M" <m...@ward-murphy.co.uk>
Subject Re: HttpSession issues
Date Wed, 18 Dec 2002 11:29:15 GMT
Yep, that's the problem!
Try keeping a list of the names that you want to remove until you've
finished iterating the loop, then remove them all at once?

Mike
----- Original Message -----
From: "Felipe Schnack" <felipes@ritterdosreis.br>
To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
Sent: Wednesday, December 18, 2002 11:12 AM
Subject: Re: HttpSession issues


  Yes, but this is related to an user session. How is possible to have
concurrent updates on an user session when an user have only one browser
window open and does a refresh? This iteration is done in a taglib. And
why this only happens when he refreshes the pages, but not when he hits
enter in the url bar?
  BTW, inside this loop in some circumstances I change the session
attributes. In other words, the code look like this:

Enumeration attrs = session.getAttributeNames();
while(attrs.hasMoreElements())
{
String name = (String)attrs.nextElement();
Object value = session.getAttribute(name);
if (<some weird conditions>)
{
session.removeAttribute(name);
}
}

  This removeAttribute() is the problem?




--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message