title: Not able to get form values to action class
body: <p>This is my code, I am not able to get form value to action class in struts2, I tried request.get and using bean, but not able to do it. Please help.</p>
  
  <p>I have tried doing <code>request.get</code> and using bean, it didn't work, can you tell me how can I get the value. I want to get <code>docKey</code> value from jsp and process it and do some operation on it.</p>
  
  <pre><code>public String execute(){
  
      try {
          //HttpServletRequest request = ServletActionContext.getRequest();
          Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");  
          Connection connection = (Connection) DriverManager  
                  .getConnection(  
                  "jdbc:sqlserver://myipaddress:51433;databaseName=dbname;selectMethod=cursor",  
                          "user", "passwd");  
  
          System.out.println("DATABASE NAME IS:"  
                  + connection.getMetaData().getDatabaseProductName());
          System.out.println("");
          Statement statement = connection.createStatement();  
          ResultSet rs = statement  
          .executeQuery("select createdOn,ReceivedOn,docKey from table where   docKey=?");
           //rs.setString(1, Mssql.bean.getdocKey());
         // I want to get that docKey value from jsp/////
          while (rs.next()) {  
              //System.out.println("createdOn:" + rs.getString("createdOn"));
              bean bean = new bean();
              bean.setdocKey(rs.getString("docKey"));
              bean.setcdate(rs.getString("createdOn"));
              bean.settstamp(rs.getString("ReceivedOn"));
          }  
      } catch (Exception e) {  
          e.printStackTrace();  
      } 
  
  
      return "check";
  
  This is my jsp
       &lt;s:form action="Mssqltest"&gt;
       &lt;tr&gt;
       &lt;td&gt; 
       &lt;s:textfield name="docKey" label="docKey"&gt;&lt;/s:textfield&gt;  
       &lt;/td&gt;
       &lt;s:submit value="Get Records"&gt;&lt;/s:submit&gt;
       &lt;/tr&gt;
       &lt;/s:form&gt;
  
      This is my struts.xml
  
       &lt;action name="*Mssqltest" class="Mssql.IRcheckairtel"  method="{1}"&gt;
      &lt;result name="check"&gt;airtelresult.jsp&lt;/result&gt;
  &lt;/action&gt;
  </code></pre>