title: Post-Redirect-Get when passing data to the form?
body: <p>I have several scenarios where a servlet needs to pass data to a form in a JSP from the retrieved records from the database. Currently, I'm storing this information in the request, using a RequestDispatcher to forward to the page, and all is well.</p>
  
  <p>However, this is not fitting with the PRG pattern (AFAIK), and of course means that refreshing of the resulting JSP means re-running of the servlet, which is undesirable.</p>
  
  <p>I could of course store these values in the session, but that would mean clearing them afterwards, and even using the session seems like a bit of a hack for displaying a record from the database.</p>
  
  <p>I am simply wondering what would be the best practice in this situation? Should I continue using the request, use the session, or some other technique?</p>
  
  <p>Thanks in advance.</p>
  
  <p><strong>Edit:</strong>
  After reading several articles and stack overflow answers, I can find nowhere that presents any other option than using the request and a dispatcher when passing data from a servlet to a JSP. It doesn't seem right to me, but neither does the session. Can anybody shed some light on this?</p>