1,HttpServletRequest
request.setAttribute("req","HttpServletRequest");
<span th:text="${#httpServletRequest.getAttribute('req')}"></span>
<span th:text="${#request.getAttribute('req')}"></span>
2,HttpSession
request.getSession().setAttribute("ses","HttpSession")
<span th:text="${session.ses}"></span>
<span th:text="${#session.getAttribute('ses')}"></span>
3,ServletContext
request.getSession().getServletContext().setAttribute("app","Application")
<span th:text="${application.app}"></span>
<span th:text="${servletContext.getAttribute('app')}"></span>