title: Call Session Attributes in JSP
body: <p>I currently have the following:</p>
  
  <pre><code>HttpSession session = request.getSession();         
  String discountError = (String) session.getAttribute("discountError");
  
  if (discountError.equals("true")){
      session.setAttribute("discountAdded", "false");
      forwardPage = "DiscountEnd.jsp";
  
  }
  else if (discountError.equals("false")){
      session.setAttribute("discountAdded", "true");
      forwardPage = "Confirm.jsp";                
  }
  </code></pre>
  
  <p><code>JSP</code></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  pageEncoding="ISO-8859-1"%&gt;
  &lt;%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %&gt;
  &lt;%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %&gt;
  &lt;%@ page session="true" %&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
            "http://www.w3.org/TR/html4/loose.dtd"&gt;
  
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"&gt;
  &lt;title&gt;Discount(s) Added Successfully&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;c:choose&gt;
      &lt;c:when test="${discountAdded == 'true'}"&gt;
          &lt;p align="center"&gt;  
              All Discount(s) added successfully!     
          &lt;/p&gt;
      &lt;/c:when&gt;
      &lt;c:when test="${discountAdded == 'false'}"&gt;
          &lt;p align="center"&gt;
              Error Found! No Discounts added!
          &lt;/p&gt;
      &lt;/c:when&gt;
  &lt;/c:choose&gt;
  
  &lt;br&gt;
  &lt;form action='HotelOwnerController' method='POST' style="text-align:center"&gt;
      &lt;input  type="submit" name="action" value="Back to Welcome Screen"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p>When I get to the <code>JSP</code> page, I am finding that the <code>discountAdded</code> <code>if</code> condition is not being evaluated.</p>
  
  <p>Would someone know how I can read <code>session</code> attributes in a <code>JSP</code> page?</p>