title: How to clear the message after page refresh in JSP
body: <p>I have a jsp page &amp; an underlying servlet which is used to upload a file from the jsp. Once the file is uploaded, it displays a message on the same jsp.
  But after page refresh also, the message still displays. I tried <code>session.removeAttribute("Message");</code>
  But it didnt work. 
  Can anyone help please</p>
  
  <p>Servlet Code</p>
  
  <pre><code>message = "File Uploaded Successfully";
  request.setAttribute("Message", message); // forwards to the message
  page.getServletContext().getRequestDispatcher("/tabs.jsp").forward(request, response); 
  </code></pre>
  
  <p>Jsp Code</p>
  
  <pre><code>&lt;% if (request.getAttribute("Message") != null) { %&gt;
  &lt;div class="uploadMsg"&gt;
      &lt;p&gt;
          &lt;b&gt;&lt;%=request.getAttribute("Message")%&gt;&lt;/b&gt;
      &lt;/p&gt;
  &lt;/div&gt;
  &lt;% } 
  session.setAttribute("Message", null); %&gt;
  </code></pre>