You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Griffith, Michael *" <Mi...@fda.hhs.gov> on 2008/04/24 21:41:38 UTC

Spring Struts Plugin workaround for Session Scoped Beans

Hi,

 

>From the docs, I found this link/note: To use session-scoped components
with Spring and Struts, see the Spring Session Components Workarounds
analysis.  That led to confluence page that doesn't yet exist. I am
using a session scoped spring bean in a struts 2 action, and it seems to
be working OK, but is there something I might be missing?

 

My bean is defined as such:

 

    <bean id="questionSequence"
class="gov.hhs.fda.service.impl.QuestionSequenceImpl" scope="session">

                        <aop:scoped-proxy/>

    </bean>

 

I have the RequestContextListener listener declared as per the Spring
documentation as well.  I'm just wondering what the work around
documentation was supposed to be?

 

Also, if I have a method getValueObject() on my action that returns a
model, how do I get Spring to use that method to inject my service on
the constructor?  I want something like:

...

QuestionSequenceImpl( ValueObject vo ){ 

   this.vo= vo;

}

 

Thanks in advance!

Michael Griffith