title: Struts2 parameters is coming null in action class
body: <p>i am not able to get the value of the text entered in the textbox in jsp into my action class. below are my files. can anyone please help as this is very urgent.</p>
  
  <p>my jsp is </p>
  
  <pre><code>&lt;%@ taglib uri="/struts-tags" prefix="s" %&gt;
  &lt;html&gt;
  &lt;body&gt;
    &lt;s:form action="login" method="post"&gt;
      &lt;s:textfield name="userName" label="User Name" /&gt;
      &lt;s:submit type="button" id="submit" label="Submit"/&gt;
      &lt;s:reset id="reset" label="Reset"&gt;&lt;/s:reset&gt;
    &lt;/s:form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>my action class is </p>
  
  <pre><code>import com.opensymphony.xwork2.ActionSupport;
  
  public class LoginAction extends ActionSupport {
  
      private String userName;
  
      public String getUserName() {
          return userName;
      }
  
      public void setUsername(String username) {
          this.userName = username;
  }
  
  
      public String execute(){
                  System.out.println("the userName is "+this.getUserName());
              return SUCCESS;
      }
  }
  </code></pre>
  
  <p>and my struts.xml is </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE struts PUBLIC
      "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
  "http://struts.apache.org/dtds/struts-2.0.dtd"&gt;
  
  &lt;struts&gt;
          &lt;include file="struts-default.xml" /&gt;
      &lt;package name="default" extends="struts-default"&gt;
          &lt;action name="login" class="core.login.LoginAction"&gt;
              &lt;result  name="error"&gt;&gt;/webpages/login/Error.jsp&lt;/result&gt;
              &lt;result name="success"&gt;/webpages/home/Home.jsp&lt;/result&gt;
          &lt;/action&gt;
      &lt;/package&gt;
  &lt;/struts&gt;
  </code></pre>