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