Struts: solving “According to TLD or attribute directive in tag file, attribute value does not accept any expressions”
This error happens when you try something like:
<s:textfield value=”${someField}”/>
And it is caused because, starting from struts 2.1.x, JSP EL expressions are not allowed in in the tag’s attributes to avoid a security issue.
Use OGNL instead.
If you have a custom .tag file (where you’d use ${someField}), you can replace this with %{#attr.someField}.
Your s:textfield in the .tag file would then become:
<s:textfield value=”%{#attr.someField}”/>
Advertisement