Access Servlet Session Attribute Using JSTL

In Java this piece of code, request.getSession().getAttribute(“my_var”) can be accessed using JSTL with the sessionScope keyword. To access my_var, call sessionScope.myvar.

Remember to use sessionScope because if your Java code looks like this: request.getAttribute(“my_var”) will not work. See sample JSTL code below.

<c:out value="${sessionScope.my_var}"/>
Bookmark and Share

Found this post useful? Buy me a cup of coffee or help support the sponsors on the right.

Related Posts with Thumbnails

1 Star2 Stars3 Stars4 Stars5 Stars (2 votes, average: 5.00 out of 5)
Loading ... Loading ...

Leave a Reply