Home > Uncategorized > Struts: solving “According to TLD or attribute directive in tag file, attribute value does not accept any expressions”

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
Categories: Uncategorized Tags: , , , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.