十一 Thymeleaf语法详解-获取作用域对象中的数据

@Controller
public class DemoController {
	@RequestMapping("/showInfo5")
	public String showInfo5(HttpServletRequest request, Model model) {
		request.setAttribute("req", "HttpServletRequest");
		request.getSession().setAttribute("sess", "HttpSession");
		request.getSession().getServletContext().setAttribute("app", "Application");
		return "index5";
	}
}




Thymeleaf语法详解-获取作用域对象中的数据


	Request:
	
Session:
Application:
@SpringBootApplication
public class App {
	public static void main(String[] args) {
		SpringApplication.run(App.class, args);
	}
}

1 HttpServletRequest

Request:

2 HttpSession

Session:

3 ServletContext

Application:

 

你可能感兴趣的:(SpringBoot)