I am trying to create a registration form. For this I use html in conjunction with thymeleaf. For some reason, after making the necessary fragments of thymeleaf in html, part of the page with the actual form has ceased to appear. It seems to do everything on the tutorial. Googled a lot, found a bunch of options to improve my code in other places, but I didn’t attack the solution of my question. Please help resolve the issue. When I open the "view code" on the open page, I see that the panel displays an error message - "Failed to load resource: the server responded with a status of 500 ()". I understand the problem may lie in the server part. Although I have no idea what could be wrong there. My spring controller just displays the view on the screen. There is no action inside. Below is an excerpt of my code. Please tell me what I am missing and where you can see. Google a lot, but did not find the answer.

<div class="container" id="container-middle"> <!--/*@thymesVar id="user" type="com.mypath.model.UserDetails"*/--> <form class="form-horizontal" role="form" id="register-form" method="post" action="#" th:action="@{/post-user-info}" th:object="${user}"> <h2 id="form-header">Sign up for BlaBlaService</h2> <div class="form-group"> <label for="login" class="col-sm-5 control-label">Login:</label> <div class="col-sm-4"> <input type="text" id="login" placeholder="Login" class="form-control" th:field="*{login}"> </div> </div> <div class="form-group"> <label for="first-name" class="col-sm-5 control-label">First name:</label> <div class="col-sm-4"> <input type="text" id="first-name" placeholder="First name" class="form-control" th:field="*{firstName}" required="required"> </div> </div> <div class="form-group"> <label for="last-name" class="col-sm-5 control-label">Last name:</label> <div class="col-sm-4"> <input type="text" id="last-name" placeholder="Last name" class="form-control" th:field="*{lastName}"> </div> </div> <div class="form-group"> <label for="email" class="col-sm-5 control-label">Email:</label> <div class="col-sm-4"> <input type="email" id="email" placeholder="Email" class="form-control" th:field="*{email}"> </div> </div> <div class="form-group"> <label for="password" class="col-sm-5 control-label">Password:</label> <div class="col-sm-4"> <input type="password" id="password" placeholder="Password" class="form-control" th:field="*{password}"> </div> </div> <div class="form-group"> <label for="birthDate" class="col-sm-5 control-label">Date of birth:</label> <div class="col-sm-4"> <input type="date" id="birthDate" class="form-control" th:field="*{birthDate}"> </div> </div> <div class="form-group"> <label class="control-label col-sm-5">Gender:</label> <div class="col-sm-4"> <div class="row"> <div class="col-sm-12"> <label class="radio-inline"> <input type="radio" th:field="*{sex}" value="female">Female </label> <label class="radio-inline"> <input type="radio" th:field="*{sex}" value="male">Male </label> </div> </div> </div> </div> <div class="form-group"> <div class="col-sm-3 col-sm-offset-5"> <button type="submit" class="btn btn-primary">Register</button> </div> </div> </form> </div> 

Closed due to the fact that off-topic participants ߊߚߤߘ , Denis Bubnov , rdorn , Streletz , m9_psy 19 Mar '17 at 22:09 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - ߊߚߤߘ, Denis Bubnov, rdorn, Streletz, m9_psy
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • It seems to have solved the question. I just looked at it and realized that I actually didn’t transfer any model to the view in order to get the result. - Barmaglot1990

1 answer 1

I did not insert into the controller a model in which I could put the result of filling out the form. Accordingly, it did not display it.

  • Question: why minus, if I myself answered my question, even if an error occurred due to my oversight? - Barmaglot1990