package com.ssm.model.validator;

import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

import com.ssm.model.system.SysUser;
/**
 * 用户登录表单验证
 * @author xk
 */
public class UserLoginValidator implements Validator{

	@Override
	public boolean supports(Class<?> arg0) {
		return SysUser.class.equals(arg0);
	}

	@Override
	public void validate(Object arg0, Errors errors) {
		ValidationUtils.rejectIfEmpty(errors, "employeeno", null, "用户名不能为空");
		ValidationUtils.rejectIfEmpty(errors, "password", null, "密码不能为空");
	}

}
