准备工作
首先,构建一个简单的Web工程,以用于后续添加安全控制,也可以用之前Chapter3-1-2做为基础工程。若对如何使用Spring Boot构建Web应用,可以先阅读《Spring Boot开发Web应用》一文。
Web层实现请求映射
@Controller
public class HelloController {
@RequestMapping("/")
public String index() {
return "index";
}
@RequestMapping("/hello")
public String hello() {
return "hello";
}
} /:映射到index.html
/hello:映射到hello.html
实现映射的页面
src/main/resources/templates/index.html
Spring Security入门
欢迎使用Spring Security!
点击 这里 打个招呼吧
src/main/resources/templates/hello.html
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/3378/viewspace-2802196/ ,如需转载,请注明出处,否则将追究法律责任。