struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Cook" <>
Subject RE: Some Spring/Struts questions
Date Wed, 12 May 2010 09:15:17 GMT
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 [] 
Sent: 12 May 2010 09:58
Subject: Some Spring/Struts questions


Apologies if this would be better asked in a Spring forum. If so, I
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
inject certain things into certain places. This seems to work well and
are all currently happy bunnies.

A new requirement means that we need to have available across pretty
every action a separate, independent bean that carries information that
(or may not) need to be displayed on the resulting web-pages. I am
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
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
a single configuration and have that work automatically for all
(and this would be a useful trick for some other places in the
but that does not seem to be possible unless I'm missing a trick?

How should I configure this, please?


View this message in context:
Sent from the Struts - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message