Help the world stop coronavirus! Stay home!

Prev Next

JSP / JSP interview questions

How do I access session scoped attributes in JSP?

Using the below scriptlet in JSP, the session attributes can be accessed.

<%=request.getSession().getAttribute("sessionVariable")%>

Also the session attributes could be accessed using JSTL and Expression Language tag as shown below.

<c:out value="${sessionScope.sessionVarible}"/>

or using,

<c:out value="${sessionScope['sessionVariable']}"/>

❤Cash Back At Stores you Love !!!❤

Earn your $10 reward when you make your first purchase through Ebates by signing up with clicking below button.

Ebates Coupons and Cash Back

More Related questions...

Show more question and Answers...

#

Comments & Discussions