You could, add the bean to the servlet context, and access it via a
scriptlet in the jsp. Thus bypassing your actions all together.

Or.. Create filter/Inteceptor and inject into them?

-----Original Message-----
From: Andy Law [mailto:andy....@roslin.ed.ac.uk] 
Sent: 12 May 2010 09:58
To: user@struts.apache.org
Subject: Some Spring/Struts questions


All,

Apologies if this would be better asked in a Spring forum. If so, I
would
appreciate guidance as to which one/where.

I have a Struts2 application with around 30 actions. Most inherit from a
common base class. We have configured the system to start to use Spring
to
inject certain things into certain places. This seems to work well and
we
are all currently happy bunnies.

A new requirement means that we need to have available across pretty
much
every action a separate, independent bean that carries information that
may
(or may not) need to be displayed on the resulting web-pages. I am
wondering
what the best way is to make this bean available to each JSP.

I'm happy with injecting certain beans into certain actions, but I'm not
clear what I should be injecting *this* bean into. Ideally it should
just
pop into existence and be available to the JSPs without the Actions even
being aware that it is there. It's not part of the business logic and is
purely informational. If I have to make it available through the Actions
then I would *like* to be able to inject it into the common base class
with
a single configuration and have that work automatically for all
sub-classes
(and this would be a useful trick for some other places in the
application)
but that does not seem to be possible unless I'm missing a trick?

How should I configure this, please?

Later,

Andy
-- 
View this message in context:
http://old.nabble.com/Some-Spring-Struts-questions-tp28533505p28533505.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

Reply via email to