1.

What Is The Purpose Of @requiredstringvalidator Annotation?

Answer»

This validation ANNOTATION checks that a String field is not empty (i.e. non-null with a length > 0).

public class Employee EXTENDS ActionSupport{

@RequiredStringValidator(message = "Default message", 

key = "i18n.key", SHORTCIRCUIT = TRUE, trim = true)

public String getName() {

RETURN name;

}

}

This validation annotation checks that a String field is not empty (i.e. non-null with a length > 0).

public class Employee extends ActionSupport{

@RequiredStringValidator(message = "Default message", 

key = "i18n.key", shortCircuit = true, trim = true)

public String getName() {

return name;

}

}



Discussion

No Comment Found