File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Thread safe Struts Action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Thread safe Struts Action" Watch "Thread safe Struts Action" New topic

Thread safe Struts Action

Abebe Belew

Joined: Jul 21, 2004
Posts: 19
I put the userid in session variable at login. the login page is forwarded to setupAction upon successful login. In setupaction I get the session attrbute and display it in jsp.

The problem is with multiple users of the app simultinously. usr A logs in successfully. user B logs in successfully in another browser. when I go back to user A's browser I see user B's info.

Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Are you running this test with two different machines? If not, it's not a valid test. In most cases, Internet Explorer will cause a Java Application server to think that two separate browser windows on the same machine still belong to the same session. If you only have one machine to test with, you might try having one user use FireFox and another IE.

Consultant, Sima Solutions
Abebe Belew

Joined: Jul 21, 2004
Posts: 19
Thanks for your reply.
I am testing this in two different machines, same browser.
The problem happens if tow users are accessing the app at the same exact time.
Eugene Abarquez
Ranch Hand

Joined: May 18, 2006
Posts: 211
Hello guys,

I am using Struts 1.2 and I am having the same issue. Two different users login to the same application simultaneously (on different machines). After which, we try testing it by having USER A search in one page and USER B search in another (different page) almost at the same time. The result causes either a 404 Page Not Found error in one of the user's screen, or the display in one of the user's screen to be messed up (i.e. it it mixed up with the page display of the other user).

I have no idea what is causing this problem. Is this a Struts issue?

There's so much to learn in this industry, and not everybody has the necessary interest.
I agree. Here's the link:
subject: Thread safe Struts Action
It's not a secret anymore!