Browse Source

user, jsp -> html , test

pull/4/head
shengzhaoli.shengz 1 year ago
parent
commit
44d6854c4b
  1. 2
      src/main/java/com/monkeyk/sos/web/controller/UserFormDtoValidator.java
  2. 4
      src/main/resources/templates/user_form.html

2
src/main/java/com/monkeyk/sos/web/controller/UserFormDtoValidator.java

@ -48,6 +48,8 @@ public class UserFormDtoValidator implements Validator {
final String password = formDto.getPassword();
if (StringUtils.isEmpty(password)) {
errors.rejectValue("password", null, "Password is required");
} else if (password.length() < 10) {
errors.rejectValue("password", null, "Password length must be >= 10");
}
}

4
src/main/resources/templates/user_form.html

@ -31,9 +31,9 @@
<div class="col-sm-10">
<input type="password" th:name="password" class="form-control" placeholder="Type password"
required="required" th:field="*{password}"/>
required="required" th:field="*{password}" minlength="10"/>
<p class="help-block">Password, unique.</p>
<p class="help-block">Password, length >= 10 .</p>
</div>
</div>
<div class="form-group">

Loading…
Cancel
Save