On Tue, Aug 25, 2009 at 1:55 PM, Obinna <obi...@gmail.com> wrote:

>
>
>> ---------- Forwarded message ----------
>> From: Musachy Barroso <musa...@gmail.com>
>> To: Struts Users Mailing List <user@struts.apache.org>
>> Date: Mon, 24 Aug 2009 09:30:49 -0700
>> Subject: Re: Struts2SpringObjectFactory autowiring and injecting static
>> property values when
>> I can't remember for sure but there are few flags in the spring plugin
>> to configure autowiring.
>
>
Yeah, I'm aware of these, but haven't figured out a combination that does
what I want. Not sure there is one but wondering
if someone else had. If not, I'd advocate providing a patch as this can be
quite useful. FYI, the use case actually arose trying to use the
embedded-jsp
plugin to move an entire ui functional set (including its struts
configuration) into a shared jar .

- Eric


>
>
>>
>> musachy
>>
>> On Mon, Aug 24, 2009 at 2:36 AM, Obinna<obi...@gmail.com> wrote:
>> > I'm using struts with the spring object factory
>> >
>> > I'm trying to package some struts configuration such that I can define
>> some
>> > commonly reused actions in a base struts configuration file and extend
>> in
>> > multiple projects. This means that my struts configuration will be
>> generic
>> > but my spring configuration (which I use to inject project-specific
>> > properties and other beans in to my action) will be project specific.
>> >
>> > In this base struts configuration, since I can't predict what the struts
>> > action beans will be named in the project-specific spring configuration
>> > file, I need to provide the full class name for each action. However,
>> when
>> > used in a project (which extends this base struts configuration), I
>> would
>> > like to be able to inject properties into this action from my spring
>> > configuration. In my spring configuration, I provide a bean entry for
>> the
>> > struts action and inject some other bean references and some static
>> > properties. Using the default autowiring strategy, upon instantiation of
>> the
>> > action (prototype scope), the spring object factory recognizes the
>> spring
>> > configuration for the action and "autowires" it to inject ONLY THE OTHER
>> > BEAN REFERENCES. ANY STATIC PROPERTIES SET IN CONFIGURATION ARE IGNORED.
>> > Looking through the spring code, this is due to the standard
>> implementation
>> > of the the autowireByName()  method being called in Spring's
>> > AbstractAutowireCapableBeanFactory class.
>> >
>> > My question: Is there currently some combination of spring wiring
>> > strategies/ struts configuration that will allow me to do what I want
>> which
>> > is to define my struts action by Class name and yet manage it it fully
>> > (including static-property injection) from my spring configuration file?
>> I
>> > suspect others will have run in to this same issue before.
>> >
>> > Thanks,
>> > - Eric
>> >
>>
>>
>>
>> --
>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>
>
>

Reply via email to