How do you want Spring to find the Action?
autowire by name?
autowire by type?
IF you want Spring to create the Action then...
However, sometimes you might want the bean to be completely managed by
Spring.
(This is useful, for example, if you wish to apply more complex AOP or
Spring-enabled technologies, such as Acegi, to your beans.)
To do this, all you
have to do is configure the bean in your Spring applicationContext.xml
and then
change the class attribute from your Action in the
struts.xml to use the bean name defined in Spring instead of the class
name.
Your struts.xml file would then have the Action class attributes
changed..as defined here
struts.xml
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<include file="struts-default.xml"/>
<package name="default" extends="struts-default">
<action name="foo" class="com.acme.Foo">
<result>foo.ftl</result>
</action>
</package>
<package name="secure" namespace="/secure" extends="default">
<action name="bar" class="bar">
<result>bar.ftl</result>
</action>
</package>
</struts>
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung.
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est
interdite. Ce message sert à l'information seulement et n'aura pas n'importe
quel effet légalement obligatoire. Étant donné que les email peuvent facilement
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité
pour le contenu fourni.
> Date: Mon, 20 Aug 2012 14:02:36 +0200
> Subject: Re: Open session in view (JPA, struts2, Spring 3, Hibernate4)
> From: [email protected]
> To: [email protected]
>
> 2012/8/9 Mounir Benzid <[email protected]>:
> > sorry for the late response. web.xml ---> http://pastebin.com/XPiQ3ZJB
> >
> > I guess the problem might be that the transaction boundary starts and ends
> > within the controller class I wrote to manage entities. The action itself
> > doesn't participate in the transaction. If my understanding is correct then
> > the OSIV pattern needs an active transaction. Should I let spring manage the
> > action in order to propagate the transaction to it?
>
> Why not to extend OSIV to /* ?
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>