Child pages
  • Why doesn't the if tag evaluate test="

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

try either

Code Block
 <ww<s:if test="%{#parameters.search[0] == 'something'}">
   ....
 </wws:if>

or

Code Block
 <ww<s:if test="#parameters.search[0] == 'something'">
   ....
 </wws:if>

Why to use search [ 0 ]?

The reason is that #parameters would return a Map, WebWork the framework conveniently make makes request parameters into a Map to make unit testing action easier and WebWork the framework also uses

Code Block
 request.getParameterMap();

which returns a map Map where the key is the parameter (String) while the value is an array of the parameter value (Array of String), hence the need to use [ 0 ].