Как связать регистрацию html с постмаппингом - PullRequest
0 голосов
/ 18 февраля 2019

iv получил страницу регистрации html с кнопкой отправки.У меня есть RESTController, который должен публиковать из этой формы @RequestBody.

Как я могу их соединить?

    @RestController
    public class RestControllerExample {
        @PostMapping("/registration")
        public void postLogin(@RequestBody User user) {
        logger.info(user.getEmail());
        }
    }



    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta content="text/html" charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
    <link href="/style.css" rel="stylesheet">
    <title>login</title>
    <style>
    </style>
    </head>
    <body>

    <div class="login-page">
    <div class="form">
      <form action="/registration-form">

        <input type="text" placeholder="email address"/>
        <input type="password" placeholder="password"/>
        <input type="password" placeholder="repeat password"/>
        <input type="button"value="Submit" onclick="getRegistration()"/>
        <p class="message">Already registered?<a href=/login>Login</a></p>
      </form>
    </div>
    </div>
    </body>
    </html>

Мне нужно написать javascript?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...