Is Struts Action class Thread Safe?

Answer Posted / styphy

In Struts-1x there will be only one instance of action
class. Hence it is not thread safe and the programmer has to
make sure that the code is thread safe.

In Struts 2x Action objects are instantiated for each
request, so there are no thread-safety issues. (In practice,
servlet containers generate many throw-away objects per
request, and one more object does not impose a performance
penalty or impact garbage collection.)

Is This Answer Correct ?    14 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between validation.xml and validator-rules.xml files in struts?

511


What is the purpose of @results?

582


What are the Core classes of Struts Framework?

583


What is ognl?

598


Why do we need mapdispatchtoprops?

473






What is struts-default package and what are it’s benefits?

573


What are the bundled validators?

587


Explain the necessity of empty tag?

596


What are action errors and error?

573


What are the classes used as part of struts framework ?

519


What is the purpose of @action annotation?

565


What are the reasons for an error message not being displayed while developing struts application?

547


What is discontinuous strut?

490


What are the action classes in struts?

517


Can we handle exceptions in Struts programmatically?

513