I have an entry form. When the user clicks on submit, the information is stored into the DB and the user is sent back to the same form with an alert message informing him that the DB insert was successful. I set a request attribute that the JSP checks to see if the DB insert is successful. If so, then the alert message is displayed and then I remove the attribute from the request.
Using tokens, I was able to display the same page without the alert message when the user refreshes the page.
My problem is when the I click the back button and then press the forward button again, the alert message is redisplayed. It's like when I hit the back button, the attribute that I have set subsequently removed still persist.
What work arounds can I do to clear the attribute permanently from the request and prevent the alert from firing when I go back or forward a page?
I am using Struts framework BTW but I feel this is more on the JSP side.
I believe that when you press the forward button, your browser is just redisplaying the results - this is normally the case unless you're using https. If the above is true, then your web server is not involved and neither are request attributes.