Whether you do back or refresh, the browser generates only requests (get or post in this case) to the server. There is no way to distinguish between the request generated from a back button, refresh or submit.
Thanks for the information.
If you have an indication of where user is or status of user (logged in or logged out) in session, this is easy to do.
In my case user is logged in.
I had set the userName as session attribute in personal page, evaluated that session attribute in login.jsp page and if the user is still in the session transfer him to his personal page. This is fine when the user uses refresh/reload button. But the same logic executes even when the user clicks his Browser Back Button. Since both makes a get request.
LoginPage.jsp
<%
String userName = (String) session.getAttribute("username");
if(userName!= null) {
System.out.println("In Session user: " + str);
response.sendRedirect("/PostRedirectGet/PersonalPage.jsp");
%>
Note: Try this
Log in to your Yahoo account. You will be taken to your personal page. Now just click the Browser Back Button. You will be taken back to your log in page. (You are still a logged-in user which means user is in session). Now click the refresh/reload button. You will be taken back to your pesonal page without requiring to type in your username/password.
I like to do the same thing in my application.