title: JSP, Java, JSTL, and Servlets to implement PRG on MVC Management web app with login/logout
body: <p>I'm using JSP, Java, JSTL, and Servlets to implement a basic store manager Web app.</p>
  
  <p>I'm attempting to implement the PRG (POST-Redirect-GET) pattern on top of the MVC (Model-View-Controller) pattern.</p>
  
  <p>I'm not sure if PRG is going to work for what I want.</p>
  
  <p>I want a user to be able to log in, visit several <em>logged-in-only</em> pages, logout, and then when he refreshes, goes back (or forward), he is only taken to the login page.</p>
  
  <p>The problem arises when a logged-in user goes to a <em>logged-in-only</em> page. <code>response.sendRedirect(urlInStringForm)</code> kills all of the request parameters. Sure, you can store stuff in HTTP session, but if you have one PageController servlet, then that servlet will surely be looking for said session data... and the user ends up on the same page if he clicks back or forward (assuming forward goes to some other resource which is redirected to the PageController). I'd like to keep the 1-PageController approach if possible.</p>
  
  <p>Seems like a lose-lose situation. Any workarounds?</p>