I work with Spring Boot. I do not have a web.xml and jsp file
I have a controller that processes the data and writes it to the database.
@RequestMapping(value = "/registration", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
@ApiOperation(value = "Registration user", response = Account.class)
public AccountDto registration(@Valid @RequestBody RegistrationDto registration, HttpServletResponse response) {
Account account = new Account(registration.getEmail(), registration.getPassword());
return new AccountDto(account);
}
I checked the controller with the help of the Swagger it works.
And I have an HTML page in which the user enters data.
<body>
<h1 th:inline="text">Please register</h1>
<form th:action="@{/logout}" method="post">
<div>
<label>
E-mail:<input type="email" name="email"/>
Password:<input type="password" name="password"/>
</label>
</div>
<input type="submit" name="registration" value="Registration"/>
</form>
</body>
How to transfer data from the page to the controller?
Thank you for your help