Thymeleaf获取作用域对象中的数据

Controller层

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

Html视图层





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


	Request:
	
Session:
Application:

 

你可能感兴趣的:(Thymeleaf获取作用域对象中的数据)