List list = this.getHibernateTemplate().find(" from User where username= ? and password= ? ",user.getUsername(),user.getPassword()); if(list.size()!=0) { return list.get(0); }
**
so basically complete the next to complete a small part.
If the return value in the list with the login method Action of
the User exitUser = userService.login (User);
System.out.println (exitUser);
IF (exitUser == null) {
System.out.println ( "Error Log");
this.addActionError ( "user name or password error");
return "loginInput";
} the else {
ServletActionContext.getRequest () the getSession () the setAttribute ( "exitUser", exitUser);..
return "loginSuccess";
}
then the page wrong message <s: actionerror />
If parity error is to use <s: fielderror fieldName = "name value">.
. ServletActionContext.getRequest () getSession () setAttribute ( "exitUser", exitUser);.
The value of the user stored in the page is determined
<S: = IF Test "# session.exitUser = null!">
<S: Property value = " # session.exitUser ">
</s:if>
<s:else>