Mark
Mark

Reputation: 70010

Struts 2 - comparing objects

i'm trying to compare a value to an Enum in Struts:

<s:if test="%{myValue == com.app.core.Values.ALL}" />

where myValue is declared in the Action and com.app.core.Values is declared in another project that is referenced to this one.

Any tips?

Thanks

Upvotes: 1

Views: 340

Answers (1)

Todd Owen
Todd Owen

Reputation: 16228

See Accessing static properties in the Struts documentation.

I think what you need is:

<s:if test="myValue == @com.app.core.Values@ALL">

You may also need to set the struts configuration constant struts.ognl.allowStaticMethodAccess to true.

Upvotes: 3

Related Questions