2

I'm trying to use basic DI with Struts2 using the configuration file as described here.

However, I was not able to find what the default scope is for injecting a bean.

I know that the default scope is Singleton for Spring but I didn't want to assume the same with Struts2.

Any ideas?

Roman C
  • 49,761
  • 33
  • 66
  • 176
Mustafa
  • 2,447
  • 23
  • 31
  • 1
    You are wise in not assuming the default scope for struts2. I can't come to a conclusion either. Maybe this thread helps: http://struts.1045723.n5.nabble.com/Spring-Scope-Default-td3489074.html – acdcjunior Dec 08 '13 at 18:21

1 Answers1

0

The default scope is singleton, but there's a scope with name default which is different. May be this question let you better understand scopes in Struts2. The framework support scopes like singleton, default, and thread other scopes you should implement manually.

Look at the source code where the scopes are defined.

To clarify the scope named default means a one instance per injection. You can find this in comments to Scope.DEFAULT.

Community
  • 1
  • 1
Roman C
  • 49,761
  • 33
  • 66
  • 176