Do all the ActionMappings share one action instance? What happens when I have a custom Action that uses property setters from the struts-config.xml to set properties during use of that action.

Ted Husted

Yes, all the ActionMappings share one Action instance. But, you wouldn't be setting the properties of the Action object here but the *ActionMapping* bean. To get to your custom properties, you would refer to the mapping instance that is passed to execute/perform. So, each mapping would have their own set.

The ActionMapping bean is a decorator that the Action object can use to affect its runtime behavior, but the Action objects are singletons. Which ActionMapping first triggers the instantiation of the Action doesn't matter.

HTH, Ted.
---
Struts in Action

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact