문제

I am using spring 3.0.

I have few DTOs. Can I declare them as spring beans? If so what should be the bean scope?

올바른 솔루션이 없습니다

다른 팁

Usually, DTOs instantiation is not managed by spring (for instance Hibernate often instantiates DTOs).

Spring does have a prototype scope where a new object is created each time you lookup the object from the ApplicationContext. This scope is useful when you want to define default values in spring config.

See the documentation on prototype scope, here.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top