title: (Spring) web application: show a form-save-success message without saving it in session?
body: <p>I am doing a Spring web application with many forms. A common practice when a form is successfully saved is saving a success message in session and then redirecting the user to the same or new link where the success message is displayed.</p>
  
  <p>In Spring web, this can be done like the following:</p>
  
  <pre><code>request.getSession().setAttribute("successMessage", "Form saved successfully");
  return "redirect:new_link";
  </code></pre>
  
  <p>I am hoping to make my application stateless but still follow the practice of redirecting and showing a form-save-success message. I am hoping to have an elegant solution. A simple (but I feel not elegant for a few reasons) solution is to attach the message as a string in the returned url similar to the following and let the front-end page to detect and display the message.</p>
  
  <pre><code>return "redirect:new_link?successMessage=Form-saved-successfully";
  </code></pre>
  
  <p>I think any idea or solution applies to any web applications, regardless of platforms used or programming languages.</p>
  
  <p>Any input is really appreciated.</p>
  
  <p>Thanks and regards!</p>