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:

  1. the = sign assignment, not equals ==;
  2. 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

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -