• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

FormBeans shared over Sessions/Requests

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I use Struts under Websphere 5.0 and I'm getting really weird behaviour.
When several users login at the same time, my login action seems to receive the same actionform instance most of the time. This means that a user gets the principal of another user after login.
I know that Struts reuses instances, so I implemented the reset() method and made the execute method of the action synchronized. Still no solution ...
Any help is more than welcome
Thanks in advance
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Gunther,
I've never seen that kind of problem before. Struts does reuse instances of a form if you keep it in the session scope but each session should get its own instance. The only way I can think of to see the behavior you are seeing is if the form bean used by the action is kept in the application context. I don't think Struts will do that though. Sorry I can't offer you any advice but maybe someone else can.
I do have to ask you to change your publicly displayed name -- the second name needs to be spelled out -- so that it conforms with the Naming Policy. We don't have many rules but the one about names is something that we are really particular about around here (the other being "be friendly" )
Regards,
 
Gunther Verhemeldonck
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All form beans have session scope. We currently use Struts1.1 beta3.
Maybe that's causing the problems. I'll try to convince people to switch to the final 1.1 release, but it's a large project and it's not up to me to decide.
Anyway, your help is appreciated.
 
Gunther Verhemeldonck
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After installing the latest fix-pack for the WebServer-Plugin for Websphere 5, the issue was resolved. We did not (yet) upgrade to the final Struts release.
reply
    Bookmark Topic Watch Topic
  • New Topic