Finally I was able to achieve the explicit creation of an action class as a
bean and got the object to be used to service requests.
The change I made was to remove the "id" attribute from the bean tag,
previously I was trying to map the id with the url name of the action, which
wasn't working. Now with the hit and trial I was doing, I discovered that there
is no connection between the two( I was doing this cos of some stuff I had seen
on some sites)
So if I am specifying my bean definition in applicationContext.xml as -
<bean class="com.test.LoginPage" scope="prototype">
<property name="loginName" value="Test Value"></property>
</bean>
And not doing anything extra in my action class, i was getting the action class
wired as needed.
scope="prototype" takes care of the fact that by-default all beans in spring
are created with singleton as scope.
Why can't they mention this on the spring plugin page? There is nothing
mentioned about "How-to" in context of using annotataions using convention
plugin.
How can we get this added?
Regards
Puneet babbar
-----Original Message-----
From: Łukasz Lenart [mailto:[email protected]]
Sent: Wednesday, February 29, 2012 5:34 PM
To: Puneet Babbar 2; Struts Users Mailing List
Subject: Re: Struts, spring integration while using struts annotations
Maybe it is a bug, that way I asked to check that.
2012/2/29 Puneet Babbar 2 <[email protected]>:
> Haven't tried that till now, was hoping to get some tips from the community
> users.
>
> I am able to use the default auto-wiring done by the struts2-spring plugin,
> but not able to explicitly create a bean from an action class and get that
> object used by the framework to service requests.
>
> Regards
>
> Puneet
>
> -----Original Message-----
> From: Łukasz Lenart [mailto:[email protected]]
> Sent: Wednesday, February 29, 2012 4:24 PM
> To: Puneet Babbar 2
> Cc: Struts Users Mailing List
> Subject: Re: Struts, spring integration while using struts annotations
>
> 2012/2/29 Puneet Babbar 2 <[email protected]>:
>> Tried after you suggested it, but doesn’t work :(
>
> Did you try to debug SpringObjectFactory#buildBean methods ?
>
>
> Regards
> --
> Łukasz http://www.lenart.org.pl/
> mobile +48 606 323 122, office +27 11 0838747
> Warszawa JUG conference - Confitura http://confitura.pl/