title: how to get userid and password from database and pass to Method in Spring MVC
body: <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;title&gt;User Login.&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;h4&gt;User Login.&lt;/h4&gt;
      &lt;form:form method="post" name="loginForm" action="login-check"&gt;
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt;User Name:&lt;/td&gt;
                  &lt;td&gt;&lt;form:input path="name" value="${form.name}"/&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;Password:&lt;/td&gt;
                  &lt;td&gt;&lt;form:input path="password" value="${form.password}"/&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td colspan="2" align="right"&gt;&lt;input type="submit"
                      value="Submit"&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
          &lt;div style="color: red"&gt;${error}&lt;/div&gt;
      &lt;/form:form&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This is my Controller :</p>
  
  <pre><code>@RequestMapping("/login-check")
      public ModelAndView  logincheck(@ModelAttribute Form person) {
          // TODO Auto-generated method stub
  
          int value=service.checkLogin("name", "password");
  
          if(value&gt;0)
          {
  
          return "loginsucess";
  
          }
          else
          {
              return "failure";
          }
      }
  </code></pre>
  
  <p>I have Form <code>Bean class</code>  in which we have <code>User Id</code> and <code>password</code> and Some more <code>field</code> are there with its <code>getter</code> and <code>setter</code> i want to take Input from <code>jsp</code> page and  i have to pass in <code>checkLogin method</code> here we define check Login </p>
  
  <pre><code>public int checkLogin(String userName, String userPassword) {
          // TODO Auto-generated method stub
          String SQL_QUERY = " from Form as o where o.userName=? and o.userPassword=?";
  
          int rowCount = jdbcTemplate.queryForInt(SQL_QUERY);
          return rowCount;
      }
  </code></pre>
  
  <p>i am trying to get <code>jsp</code> Input Value but unable to get please suggest me how i ll get sot that  i can apply condition for this .</p>