Here's a simple example of doing it with Spring and
JSF Login.jsp
---------
.....
value="#{loginBean.username}"
....
value="#{loginBean.password}"
.....
action="#{loginBean.loginAction}"
loginBean
--------
..
private
String username;
private String password;
public String getUsername(){return username;}
public void setUsername(String username){ this.username=username;}
public String getPassword(){return password;}
public void setPassword(String password){this.password = password;
...
public String loginAction()
{
String usernameTxt = this.getUsername();
String passwordTxt = this.getPassword();
try
{
//get the password from DB
...
//then compare with the one you get from the
JSP page
//if not match, return to login.jsp
if(...)
{
return "LOGIN_PAGE";
}
}
catch(Exception e)
{
e.printStackTrace();
return "ERROR_PAGE";
}
return "LANDING_PAGE";
}