title: Life of request scope
body: <p>I'm setting a request variable using the below code - </p>
  
  <pre><code>if (response.getEntity(String.class).equals("VALIDATED")){
              System.out.println("FileUploadValidation success ");
              req.setAttribute("validation", "VALIDATED");
              RequestDispatcher rd = req.getRequestDispatcher("/dataloads.jsp");
              rd.forward(req, res);
          }else{
              System.out.println("FileUploadValidation not-success ");
              req.setAttribute("validation", "NOT-VALIDATED");
              RequestDispatcher rd = req.getRequestDispatcher("/index.jsp");
              rd.forward(req, res);
          }
  </code></pre>
  
  <p>Now there is a error and I get the request attribute to NOT-VALIDATED. The request is sent to index.jsp... Evaluating the request scope I display a error msg using jQuery.</p>
  
  <p>Now, again when I get a request for index.jsp,  I see the "validation" attribute is still set.</p>
  
  <p>Javascript code:</p>
  
  <pre><code>if ('${requestScope.validation}' == "NOT-VALIDATED")
          {
              $('#error').show()          
          }
  </code></pre>