java - Get input values from Spring Boot Thymeleaf -


i'm attempting retrieve value java class display error. there unexpected error

(type=internal server error, status=500). exception evaluating springel expression: "staff.username" (register:22) 

this .html file

    <div class="form-group">         <label for="username" class="cols-sm-2 control-label">username</label><span class="bg-danger pull-right" th:if="${usernameexists}">username exists</span>         <div class="cols-sm-10">             <div class="input-group">                 <span class="input-group-addon"><i class="fa fa-users fa" aria-hidden="true"></i></span>                 <input type="text" th:value = "${staff.username}" class="form-control" id="username" name="username" roleid="username"  placeholder="enter username" required="required"/>              </div>         </div>     </div> 

my controller

@requestmapping(value = "/register", method = requestmethod.get) public string register(model model) {     staff staff = new staff();      model.addattribute("staff", staff);      return "register"; }  @requestmapping(value = "/register", method = requestmethod.post) public void registerpost(@modelattribute("staff") staff staff, model model) {  } 


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -