public static int VALIDATE_OK = 0 ;
public static int login(String username, String passwd) throws Exception
{
SqlMapClient client = Utils.getMapClient();
SysUser user = null;
user = (SysUser)client.queryForObject("user.getUserByUserName", username);
if(user == null) return LOGIN_ERROR;
if(user.getPassword().equals(passwd))
{
ActionContext.getContext().getSession().put("user", user);
return user.getUserId().intValue();