Problem with session attributes in JSP EL using Spring MVC

后端 未结 3 830
-上瘾入骨i
-上瘾入骨i 2020-12-16 20:38

I\'m trying to show a session attribute \"userSession\" in a jsp page using JSP EL, but it returns null (case 1). Request attributes are shown properly in EL expressions tho

3条回答
  •  盖世英雄少女心
    2020-12-16 21:02

    Fixed. Problem was with a <%@ page session="false" %> directive found in an include.jsp used by my page, which I removed from that global place.

    It prevents a jsp page from access to session scope variables. So only <%=request.getSession().getAttribute("foo")%> works in that case...

提交回复
热议问题