Is Action Class is threadSafe in Struts?

Posted on 2008-11-05
Last Modified: 2013-11-24
Is Action Class(user define Action Class) is threadSafe in Struts by defaul?
MyAction extends Action {
execute(, , , ,) {
  IF this class(MyAction) is thread safe then is the methods of all the classes(Bussiness, DAO) that called in execute() method is thread-safe(means no need to worry about thread safty in Struts application)
Question by:Asheesh_Kumar
    LVL 14

    Accepted Solution

    Struts 1 action are singleton and worked same like servlet which there is only one instance shared by multiplethread. Methods called in the execute() method are thread-safe as long as they are not a new instance declared as local variable in the action class.

    Here is the guideline on how to design the action class in struts 1:

    Struts 2 action are instantiated on each request, so you wont have the problem face in Struts 1.
    LVL 2

    Expert Comment

    sorry for the disturb,

    boonleng could  u plz have a look at this problem og  gettting back param from each html:text to html:link


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Title # Comments Views Activity
    Fibonacci challenge 11 61
    count7 challenge 12 52
    Understanding websocket example in spring 1 20
    wordappend challenge 8 42
    Using Quotation Marks in PHP This question ( seems to come up a lot for developers who are new to PHP.  And it got me thinking, "How can we explain the rule…
    A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
    This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
    Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now