/*@everything * How to internationalize here */ @NotEmpty(message="login.account.not.empty") @Column(name = "name") private String name; // @Email(message = "Must be in Email format") @Column(name = "href") private String href;
Injected validation, like this
How to internationalize the output on the page?
<div class="col-sm-10"> <input type="text" class="form-control" id="name" placeholder="菜单名称" name="name" th:field="*{name}"/> <span th:if="${#fields.hasErrors('name')}" th:errors="*{name}" th:text = "#{${#fields.errors('name')[0]}}" >Name Error</span> </div>
I wrote it like this, can it be implemented, is there a simpler way?