The controller loads only a String object, but not an html page. Page login.html is in directory templates. Effect is text 'login" on page. Project is in Spring Boot.
@RestController
public class Company {
@RequestMapping("login")
public String company() {
return "login";
}
}
@SpringBootApplication
public class ComJonkSpringBootMvcApplication {
public static void main(String[] args) {
SpringApplication.run(ComJonkSpringBootMvcApplication.class, args);
}
}
<!DOCTYPE HTML>
<html>
<head>
<title>Yahoo!!</title>
</head>
<body>
Name : <input name="name" type="text" /> Password : <input name="password" type="password" /> <input type="submit" />
</body>
</html>
...Controller, and if you're already using Spring Boot, you may as well use Spring Security, which still wants the HTML for the login page but will take care of the mapping itself.