jeudi 19 février 2015

Java spring annotation attribute

I have a post method receiving an object as parameter, in this object I have an attribute with annotations @ValidDate and @NotEmpty.

in another method I want to use the same object but I just want annotation @ValidDate on the attribute. It's possible ?


the attribute :



@NotEmpty
@ValidDate
private String installDate;


the function :



public String findLinksByCriteria(@Valid @ModelAttribute LinkForm link, BindingResult bindingResult, Model uiModel) {
if (bindingResult.hasErrors()) {
return ViewConstants.LINK_SEARCH_VIEW;
}

Aucun commentaire:

Enregistrer un commentaire