Announcement Announcement Module
Collapse
No announcement yet.
How to access to session attributes in JSTL Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to access to session attributes in JSTL

    I try to access session attributes using JSTL and can't figure out a way.
    WHen I test browse sessionScope map, it doesn't show any values.

    This is what I do to see what's in sessionScope:

    <c:forEach items='${sessionScope}' var='p'>
    <ul>
    <li>Parameter Name: <c:out value='${p.key}'/></li>
    <li>Parameter Value: <c:out value='${p.value}'/></li>
    </ul>
    </c:forEach>

    On the contrary, when i use JSP scriplet, everything is fine:

    boolean validTransaction = Boolean.valueOf((String) request.getSession().getAttribute("validTransactio n")).booleanValue();

    I do see the right value in this case.
    Does anyone know the right way to browse session attributes from JSTL?

  • #2
    Try this:-

    Code:
    <c&#58;out value='$&#123;sessionScope&#91;"validTransaction"&#93;&#125;'/>
    Bob

    Comment

    Working...
    X