title: Recieving 'null' values from a jsp page into Struts 2 Action
body: <p>I have a jsp page and struts 2 Action class . When I submit  the form in the jsp , I am getting null values into the action.</p>
  
  <p>The JSP code looks like :</p>
  
  <pre><code>   &lt;s:form id="user" name="user" action="initUserAdmin"&gt;
  
      &lt;s:textfield name="userName"  cssClass="txtbox" size="30" /&gt;
      &lt;div class="btn"&gt;&lt;a href='&lt;s:url action="searchUserAdmin"/&gt;' 
      title="Search"    id="button" class="btn" &gt;&lt;span&gt;Search&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
  
     &lt;/s:form&gt;
  </code></pre>
  
  <p>The struts.xml has this part</p>
  
  <pre><code>      &lt;action name="*UserAdmin" method="{1}" class="com.mphasis.im.web.action.UserAction"&gt;
          &lt;result name="init" type="tiles"&gt;user&lt;/result&gt;
          &lt;result name="search" type="tiles"&gt;user&lt;/result&gt;
          &lt;result name="reset" type="tiles"&gt;user&lt;/result&gt;
          &lt;result name="createNew" type="tiles"&gt;createNewUser&lt;/result&gt;
      &lt;/action&gt;
  </code></pre>
  
  <p>And the Action class has this :</p>
  
  <pre><code>        public class UserAction extends BaseAction
            {
              public String userName;
  
          public String getUserName()
          {
        return userName;
          }
  
          public void setUserName(String userName)
          {
        this.userName = userName;
          }
  
              public String search()
             {
              searchProcessed = true;
  
              System.out.println("******** inside search ******");
  
              System.out.println("username = "+ userName);
  
              return TilesConstants.SEARCH;
             }
  </code></pre>
  
  <p>And the output comes as below when I type  a string in the text box in jsp page.</p>
  
  <pre><code>        ******** inside search ******
           username = null
  </code></pre>
  
  <p>What might be the problem ? Am I missing something ?</p>