At 8:41 AM +0200 6/2/05, Anders Sveen wrote:
Hi Rodolfo,
We are using Spring 1.2 with Struts 1.2.6 . At least with our setup, we
found that if we wanted to use Dependency Injection with Spring into our
actions, we would not be able to use our wildcard mappings. So instead we
just let our actions inherit from DispatchActionSupport, get the
ApplicationContext and do lookup of the beans in the code. Not an optimal
solution but at least it brings IoC to everything below your view, and
lets you use Springs features there.
I'm curious as to why you weren't able to use wildcard mappings?
Were you using DelegatingActionProxy? By the time the action
executes, Struts is using an ActionMapping where the wildcard value
in the path has been replaced with the real requested path -- so was
the problem that you would have had to create too many Spring bean
mappings?
Note that it's also possible to override the "determineBeanName"
method in DelegatingActionProxy so that you could use some different
logic -- for example, use the "parameter" property of the
ActionMapping to specify a single Spring bean name instead of dealing
with the volatile path. (In Struts 1.3 you can set any number of
properties on an ActionMapping without having to subclass it, which
further opens up the amount of information you could externalize to
the struts-config.xml file.)
Joe
--
Joe Germuska
[EMAIL PROTECTED]
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction" -The Ex
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]