fix: Change identifier and add error message in properties file Signed-off-by: Sukhminder Arora <sukhminderarora@gmail.com>

Signed-off-by: Sukhminder Arora <sukhminderarora@gmail.com>
This commit is contained in:
Sukhminder Arora 2025-02-11 11:49:08 +05:30
parent a75c9c4281
commit 82b248dedf
3 changed files with 6 additions and 3 deletions

View file

@ -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() {

View file

@ -47,7 +47,7 @@ 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;

View file

@ -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