mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-04-24 11:22:48 +00:00
Change identifier and add error message in properties file
Signed-off-by: Sukhminder Arora <sukhminderarora@gmail.com>
This commit is contained in:
parent
c2a2bab3f6
commit
72aaac490b
3 changed files with 7 additions and 3 deletions
|
@ -28,11 +28,11 @@ import jakarta.validation.constraints.NotBlank;
|
|||
public class Person extends BaseEntity {
|
||||
|
||||
@Column(name = "first_name")
|
||||
@NotBlank(message = "First name is required")
|
||||
@NotBlank(message = "{person.firstName.required}")
|
||||
private String firstName;
|
||||
|
||||
@Column(name = "last_name")
|
||||
@NotBlank(message = "Last name is required")
|
||||
@NotBlank(message = "{person.lastName.required}")
|
||||
private String lastName;
|
||||
|
||||
public String getFirstName() {
|
||||
|
|
|
@ -47,7 +47,8 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|||
class OwnerController {
|
||||
|
||||
private static final String VIEWS_OWNER_CREATE_OR_UPDATE_FORM = "owners/createOrUpdateOwnerForm";
|
||||
public static final String REDIRECT_OWNERS = "redirect:/owners/";
|
||||
|
||||
private static final String REDIRECT_OWNERS = "redirect:/owners/";
|
||||
|
||||
private final OwnerRepository owners;
|
||||
|
||||
|
|
|
@ -6,3 +6,6 @@ nonNumeric=must be all numeric
|
|||
duplicateFormSubmission=Duplicate form submission is not allowed
|
||||
typeMismatch.date=invalid date
|
||||
typeMismatch.birthDate=invalid date
|
||||
person.lastName.required=Last name is required
|
||||
person.firstName.required=Last name is required
|
||||
|
||||
|
|
Loading…
Reference in a new issue