wood burning stoves
The moose likes Struts and the fly likes Struts and Thread Safety Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts and Thread Safety" Watch "Struts and Thread Safety" New topic

Struts and Thread Safety

Will Farquharson

Joined: Dec 02, 2008
Posts: 20


My friend and I have recently developed a website using Stuts 1 and JDBC. We mostly learnt as we went along, and although the website seems to be working perfectly, we know enough now to realise we should be concerned about potential concurrency issues.

The website itself isn't much - it allows users to browse business listings, search for them (basic and advanced search), and allows business owners to log in and add/edit their business listing. It basically has a load of Struts Dispatch Actions with FormBeans that get populated by service classes. The service classes themselves are singletons, although I can't remember why we decided to make them this way -- they don't have any class level variables so I guess these are okay.

The problem is, we want to be 100% certain there aren't going to be concurrency issues once our site gets busier, but we're not really sure where to start. The last time we properly dealt with concurrency problems was during University classes, and they didn't really go into detail about web applications in particular.

So, my questions are...
  • Is thread safety / concurrency going to be a problem for us given our site is made with Struts?
  • If so, where might we encounter problems, and how can we test to ensure everything is okay?
  • Is there some recommending reading you could give me that will explain what we need to know in terms of Struts 1 and concurrency? (finding it hard to find good concise information on the topic that isn't totally baffling me)

  • Thank you very much!
    David Newton

    Joined: Sep 29, 2008
    Posts: 12617

    Why would you develop a new website using Struts 1? That baffling decision aside...

    Aside from the normal concurrency concerns (application-level data, singletons with shared data, etc.) the only other Struts 1-specific thing is that Struts 1 actions are like servlets: there's only one instance per mapping.

    Other than that, nothing unusual.
    I agree. Here's the link: http://aspose.com/file-tools
    subject: Struts and Thread Safety
    It's not a secret anymore!