OK things are just getting weirder...

I've been in the debugger and found that  StaticParametersInterceptor needs
to have the parameter 'parse' set to 'true' (it defaults to 'false').  If I
set parse=true then it will parse the "${'true'}" value string and correctly
call the setter with value 'true'.   I can't imagine why you would ever want
this set to false unless all your parameters are strings, yet that's the
default.

But there is still a problem...

I'm using a paramsPrepareParamsStack stack, so it first does the
staticParams interceptor and calls the setter with 'true' then the next
interceptor is 'params' and it again calls the setter but this time with
'false'.  

BTW it doesn't look like the first 'params' interceptor is doing anything so
the setter has not been called before the prepare interceptor is run, this
is not effecting me but seems wrong, seems like 'staticParams' should be
before prepare interceptor.

I broke at the setter in the debugger and see that the second call is coming
from ParametersInerceptor.setParameters()  and it has the value of
"${'true'}" which is the raw, unevaluated, unparsed, value string.  

So staticParams is now correctly setting the value to 'true' and params
interceptor is overriding it and setting it back to 'false'.

Help!



Greg Lindholm wrote:
> 
> My reply got messed up so here it is again....
> 
> When I try ${'true'} and the setter is still called with 'false'. 
> 
> 
> 2009/4/10 Greg Lindholm <glindh...@yahoo.com>:
>> I'm trying to pass a boolean "static" parameter to an Action and the
>> value getting set is always "false" no matter what I do it won't set it
>> to "true".
>>
>> <action name="MyAction"
>>           class="com.xxx.MyClass"
>>           method="doDisplay">
>>           ${true}
> 
> try
> ${'true'}
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-S2.1.6--boolean-static-parameter-for-an-action-tp22981740p22992899.html
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

Reply via email to