This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Other Application Frameworks and the fly likes Spring + struts2 DI problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Spring + struts2 DI problem" Watch "Spring + struts2 DI problem" New topic

Spring + struts2 DI problem

Sam Venkata
Ranch Hand

Joined: Mar 06, 2006
Posts: 68
I am using spring xml file to do DI into STRUTS2 Action classes. I need to inject the dependency for each request to the action class. I wanted to if it is possible. I have tried it, but the setter method is called only at the time of container startup and not for every invocation of the action class.
The bean in spring xml file looks like this

I tried setting the scope of the bean to prototype but that did not work either.

Could somebody please tell me if I am missing something.

[ March 26, 2008: Message edited by: Samanth Marisetty ]
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

I'm not clear about what the problem is, but do you know that there's also a "request" scope in Spring 2.0 ?

[My Blog]
All roads lead to JavaRanch
subject: Spring + struts2 DI problem
It's not a secret anymore!