JSTL and EL together provide an easy way to access session, request and application scope variables. EL provides implicit variables like sessionScope, requestScope, applicationScope and many more which are actually Map type. They can be navigated easily by using dot operator to access any attributes added to it.
 
Below JSP code provides a simple way of accessing and displaying the values.
 
Note that we have added the scriptlet in the page, just to show that we are adding value in session and request variables. Scriptlets should be avoided when JSTL and EL are used.
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
 
<%  //Scriptlets are not to be used
 request.setAttribute("param1", "Hello JSTL World!");
 session.setAttribute("userName", "Generic User");
%>

Hello <c:out value="${sessionScope.userName}"/>,</p>
Welcome to <c:out value="${requestScope.param1}"/></p>
 
It provides a output as below:
 
Hello Generic User,
Welcome to Hello JSTL World!
We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.