struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Micael Carreira <>
Subject Context parameters not being ignored?
Date Thu, 20 Dec 2018 19:24:50 GMT

I'm using Struts2 with Spring. I have the following action:

       |- FooService

But in my bean definition I don't have the FooService dependency because 
SomeAction doesn't use it:

     <bean id="someAction" class="SomeAction" scope="prototype" />

(Putting it this way doesn't make much sense, the real configuration is 
more complex than this, but this is the simplest example on how the 
problem can be reproduced)

Then my struts.xml redirects to a jsp result:

     <action name="SomeAction*" method="{1}" class="someAction">

And some.jsp calls other action:

     <s:action name="OtherAction" var="other" executeResult="false" 

But OtherAction actually needs FooService as a dependency, and its bean 
definition reflects that:

     <bean id="otherAction" class="OtherAction" scope="prototype">
         <property name="fooService" ref="fooService" />

I noticed that when OtherAction gets instantiated through jsp parsing, 
it first gets set with the correct fooService dependency.

However, after that, fooService then gets set with null. So OtherAction 
won't be able to correctly run.

I already assessed that the second injection is the value that is 
present in SomeAction.

But I don't want this value injected. It shouldn't be injected if I'm 
running OtherAction with ignoreContextParams="true", right?

I have been all day around this problem, so any help would be much 


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

View raw message