Sandy , which framework are you using . Spring implicitly handles this because each request madatorily hits the controller before the JSP is invoked. If you are using Struts you might have to write an Ajax call on the "onPageLoad" of the previous page which the control would go on hitting back and then send the request to a different class where you can perform some logic.
Hope this helps.