thymeleaf + spring form validation internationalization

 

/*@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?

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326969496&siteId=291194637