Validation for empty "to" and "from" fields added.

This commit is contained in:
oreva 2016-07-28 21:56:36 +03:00
parent 24c25206a4
commit 2bef18b3db
1 changed files with 5 additions and 1 deletions

View File

@ -3,15 +3,19 @@ package com.baeldung.spring.web.dto;
import org.hibernate.validator.constraints.Email;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
/**
* Created by Olga on 7/20/2016.
*/
public class MailObject {
@Email
private String from;
@NotNull
@Size(min = 1, message = "Please, specify your email address")
private String from;
@Email
@NotNull
@Size(min = 1, message = "Please, set an email address to send the message to it")
private String to;
private String subject;
private String text;