I was having some issues with how freemarker/struts handles the 'value' 
attribute on the 'param' tag. I figured it out and saw that struts will try to 
evaluate any string passed in to 'value'. Freemarker had been evaluating my 
expressions, sending in the resulting string to struts, and struts was 
evaluating it again.

After figuring that out, I assumed that other tags, like 'hidden' would behave 
the same way with their 'value' attribute, but that doesn't appear to be the 
case. It seems like I need to do the following for the 'param' tag:

    <@s.param name="foo" value="someProperty"/>

But with the hidden tag (or I'm assuming any form-based tag) I have to do:

    <@s.hidden name="foo" value=someProperty/>

or:

    <@s.hidden name="foo" value="${someProperty}"/>

Is this the expected behavior? And if so, why the different handling of the 
value attribute between the different tags? This page: 
https://struts.apache.org/docs/tag-syntax.html#TagSyntax-valueisanObject%21 
seems to indicate that all value attributes are evaluated and even gives the 
example of a textfield. But the behavior I'm seeing with hidden is that if you 
used value="someProperty", you'd get the literal string value: "someProperty" 
in the html, not the result of evaluating "someProperty" against the value 
stack.

Also, the table of parameters for all of the following tags:

https://struts.apache.org/docs/hidden.html
https://struts.apache.org/docs/textarea.html
https://struts.apache.org/docs/textfield.html
https://struts.apache.org/docs/param.html

Indicate that 'value' is a String field, even on the param page where the 
'Description' section indicates exactly the opposite.

Is there a place I could see definitively which attributes are evaluated 
against the value stack and which are taken as-is? Or am I just 
missing/not-understanding something (very likely)?

-Steven Willis

Reply via email to