Assume you have page A which is the "home" page for the web app. Assume there is a second page B which contains a form. After successfully processing the form the user is directed back to page A. If you need to display a success message for the previous action (the successful form submission), what is the best way to get that message for display?
I've narrowed it down to this:
Pass a message key to page A. Page A will then use the key to get the message from somewhere.
Pass the message to page A. However this seems to open the site up for XSS and what not.
When processing the form store the message in session scope prior to redirecting to page A. Then page A can retrieve & remove the message from session and display it on the screen.
Am I missing something? What is the preferred way to accomplish this task?