struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <lukaszlen...@apache.org>
Subject Re: Bean scope type in Struts2 plugin
Date Tue, 02 Oct 2012 06:06:37 GMT
2012/10/1 Aum Strut <aum.struts@gmail.com>:
> Hi All,
>
> i am having a small doubt  regarding bean creation in struts2,while going
> through some of the plugin i saw following code
>
> inside the Interceeptor
>
> @Inject
>     public void setMyManager(MyManager myManager) {
>         this.MyManager = myManager;
>     }
>
> and here is the entry in struts-plugin.xml file
>
>  <bean type="abc.MyManager" class="abc.DefaultManager" />
>
> My doubt is how the DefaultManager will be instantiated,since the
> intercepor will get called each time there is a call to the action for
> which this particular interceptor has been configures, so will S2 going to
> create a new instance of  "DefaultManager" or will it be a singlton which
> will get created at the time of application startup?
>
> i have tried to search docs but not able to fine anything related to this

https://svn.apache.org/repos/asf/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/inject/Scope.java

And by default the scope is DEFAULT - as above when you didn't specify
the scope.


Regards
-- 
Ɓukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message