When wil use singleton class in Struts

Answer Posted / nikel

In struts 1.x version Action class follows Single Instance Multiple Threaded model.hence WebContainer creates object for a Action class per Session basis.so Action class is not ThreadSafe.But we can make it ThreadSafe by Synchronization mechanism.

But in Struts 2.x version Action class obj is created by WebContainer per request basis.So Action class is always threadsafe.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we have multiple struts config files ?

714


What is lookupdispatchaction?

748


When do I need “struts.jar” on my classpath?

722


List some struts tag libraries?

723


How many struts config file in a struts application?

686


What are the components of struts?

711


Can you explain value stack?

697


How many struts config file can be created in struts?

648


How can forward action be used to restrict a strut application to mvc?

714


Mark the differences between html tags and strut specific html tags.

753


What do you mean by actionservlet?

752


Why we use struts in java?

683


Which interceptor is responsible for file upload support?

782


Who wrote struts?

718


What is the purpose of @emailvalidator?

732