Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What happens when Two users requests for same action class?
How the threads are controlled?

Answer Posted / rk

I do not see a single correct answer.

In Struts1, Action resources must be thread-safe or
synchronized. So Actions are singletons and thread-safe,
there should only be one instance of a class to handle all
requests for that Action. The singleton strategy places
restrictions on what can be done with Struts1 Actions and
requires extra care to develop.

However in case of Struts 2, 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.)

reference:
http://www.javabeat.net/qna/690-struts-1x-vs-struts-20/

Is This Answer Correct ?    10 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is spring and struts in java?

1042


Why are frameworks used?

1047


What are disadvantages of Struts?

1114


Why struts 1 classes are not thread safe whereas struts 2 classes are thread safe?

981


Why we use struts over servlets?

1121


What is the use of jsonvalidation?

1175


how to get the last 10 elements using logic:iterate in struts with hiernate from database.

4559


how to develop the submit and search operations in single jsp using struts?

3054


Provide some important Struts2 constants that you have used?

1048


Do I have to credit struts on my own website?

1047


How can we display all validation errors to user on jsp page?

1119


What are the important methods of actionform?

1142


In how many ways duplicate form submission can occurs?

1039


What is the purpose of @requiredstringvalidator?

996


Whats the difference between the default namespace and the root namespace?

1025