java - how can i use request parameter in struts2 if tag -
i have link :http://localhost:8080/esa/login.jsp?login=failed
in end of above link set parameter name login
, value failed
.
how can use parameter in jsp page struts if tag. use following code don't work.
<s:if test="%{#parameters.login='failed'}"> <div class="error"> <s:text name="user.login.failed"></s:text> </div> </s:if>
try with
<s:if test="%{#parameters.login[0]=='failed'}">
the 2 problems in code:
- the
=
sign assignment, not equals==
; parameters saved in
map<string, string[]>
, each parameter have multiple values , accessed specifying index.the last option described here: why doesn't
if
tag evaluate params properly.
Comments
Post a Comment