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>

相关文章:

  • 2021-08-20
  • 2021-04-21
  • 2021-06-10
  • 2021-11-21
  • 2021-05-19
  • 2021-09-03
  • 2021-08-24
猜你喜欢
  • 2021-11-01
  • 2022-12-23
  • 2022-12-23
  • 2021-07-25
  • 2021-04-22
  • 2021-12-19
  • 2022-12-23
相关资源
相似解决方案