• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts Action Intances

 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

How many action instances are created in a struts application?

The way i understand this is - If I have 10 different action classes for different use cases/actions, at any point of time, how many instances of each action class are created?

I belive it's one. But i was not sure so i did not answer this question

Any more input?

 
Manjusha Muraleedas
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The action servlet creates action instances as they are requested... but only ONE instance for each path. Thus, Action subclasses MUST be thread-safe or you'll get some very odd results!

Form instances are created based on the scope associated with the action.
scope=session: One form instance per session.
scope=request [default]: One form instance per request.

refer

http://www.coderanch.com/t/47828/Struts/When-many-ActionForm-classes-Action
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34225
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to our Struts forum
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic