Log In | Get Help   
Home My Page Projects Code Snippets Project Openings Accounting and Billing Portal
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files
[abportal] View of /src/main/java/eu/smartlm/abs/portal/security/login/admin/MyValidator.java
[abportal] / src / main / java / eu / smartlm / abs / portal / security / login / admin / MyValidator.java Repository:
ViewVC logotype

View of /src/main/java/eu/smartlm/abs/portal/security/login/admin/MyValidator.java

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (download) (annotate)
Wed Jul 28 10:05:51 2010 UTC (13 years, 9 months ago) by dgarcia
File size: 791 byte(s)
First code commit
package eu.smartlm.abs.portal.security.login.admin;

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

import eu.smartlm.abs.portal.security.login.model.User;

/**
 * Validates that user is ok when the data is introduced in the form
 * @author David García Pérez - CESGA
 */
public class MyValidator implements Validator {

	public boolean supports(Class<?> klass) {
		return User.class.isAssignableFrom(klass);
	}

	public void validate(Object target, Errors errors) {
		//User user = (User) target;
		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "username", "NotEmpty.user.username");
		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "password", "NotEmpty.user.password");
	}
}

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge