问题
Possible Duplicate:
getting new bean instances of referencing beans every time
What is a very simple way to get a new instance of an autowired class every time?
I've explored session, request, prototype, @resource. None seem to provide the desired effect.
回答1:
Use @Scope("prototype")
@Service
@Scope("prototype")
public class YourService{}
来源:https://stackoverflow.com/questions/14388480/new-instance-from-autowired-class