Dashboard > WebWork > ... > FAQ > Why doesn not WebWork If tag evaluate test=
  WebWork Log In View a printable version of the current page.  
  Why doesn not WebWork If tag evaluate test=
Added by tm_jee, last edited by tm_jee on Jun 13, 2007  (view change)
Labels: 
(None)

try either

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

or

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

Why to use search [ 0 ]?

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

request.getParameterMap();

which returns a 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 ].

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request - Contact Administrators