In the past I have done this for accessing beans in a servlet. <bean class="org.springframework.web.context.support.ServletContextAttributeEx porter"> <property name="attributes"> <map> <entry key="organisationService" value-ref="myOrganisationServiceBeanRef"/> </map> </property> </bean>
OrganisationService organisationService = (OrganisationService) getServletContext().getAttribute("organisationService"); -----Original Message----- From: Andy Law [mailto:andy....@roslin.ed.ac.uk] Sent: 12 May 2010 10:23 To: user@struts.apache.org Subject: RE: Some Spring/Struts questions James Cook-13 wrote: > > You could, add the bean to the servlet context, and access it via a > scriptlet in the jsp. Thus bypassing your actions all together. > What does the Spring configuration look like for that course of action? James Cook-13 wrote: > > Or.. Create filter/Inteceptor and inject into them? > OK. We're already doing that for some of our stuff and that kind of handles our "inheritance" problem (same injection into multiple subclass types with single configuration). It feels a bit "hacky" in this context and I'd also have to make all the actions "aware" of the object being added. The other objects that we handle in this manner are genuinely integral to the Actions (data access objects and permissions filters for example). Later, Andy -- View this message in context: http://old.nabble.com/Some-Spring-Struts-questions-tp28533505p28533688.h tml Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org