Esempio n. 1
0
 /**
  * <p>Save the specified messages keys into the appropriate session
  * attribute for use by the &lt;html:messages&gt; tag (if
  * messages="true" is set), if any messages are required. Otherwise,
  * ensure that the session attribute is not created.</p>
  *
  * @param \Symfony\Component\HttpFoundation\Session\Session session The session to save the messages in.
  * @param \Phruts\Action\ActionMessages messages The messages to save. <code>null</code> or
  * empty messages removes any existing \Phruts\Action\ActionMessages in the session.
  *
  * @since Struts 1.2
  */
 protected function saveMessagesSession(Session $session, ActionMessages $messages = null)
 {
     // Remove any messages attribute if none are required
     if ($messages == null || $messages->isEmpty()) {
         $session->remove(\Phruts\Util\Globals::MESSAGE_KEY);
         return;
     }
     // Save the messages we need
     $session->set(\Phruts\Util\Globals::MESSAGE_KEY, $messages);
 }