title: using an if statment in jsp to show alert 'this user name has been taken' from a result from action page going through struts
body: <p>I am trying to get this if statement to display </p>
  
  <pre><code>    &lt;s:hidden id="userNameTest" value="nameTest"&gt;&lt;/s:hidden&gt;
          &lt;s:if test="userNameTest.value.equals('false')"&gt;
                  That name is already in use.
          &lt;/s:if&gt;
  </code></pre>
  
  <p>if this happens in my action page</p>
  
  <pre><code>    public String createUser()
  {
      user.set_permission("user");
      if(user.get_userName().matches("^([a-zA-Z0-9]{5,15})$")&amp;&amp;(user.get_password().matches("^((?=.+\\d).{8,20})$")))
      {
          if(manager.checkUserName(user.get_userName()) == false)
          {
              manager.createUser(user);
              valueButton = "userPage";
          }
          else
          {
              valueButton = "createUser";
          }
      }
      else
      {
          nameTest = false;
          valueButton = "createUser";
      }
      return valueButton;
  }
  </code></pre>
  
  <p>I have tried making the hidden field false in the jsp onclick, I have tried making it false in the action as you see above. I have looked it up on other sites but cant find what I am after.</p>