4 Replies Latest reply on Jul 6, 2009 12:29 PM by Ionut Bucurescu

    Render mail exception invalidates request

    Tommy Key Newbie

      I have an action #{registration.register} that sends an email to user. Something like this:


      public boolean register() {
         try {
            render("registrationemail.xhtml"); //using m:message...
         } catch (Exception e) {
            log.error(e);
            return false;
         }
         return true;
      }
      


      I want to redirect it with pages.xml if mail was sent or not:


      <page view-id="/register.xhtml">
      <navigation from-action="#{registration.register}">
        <rule if-outcome="true">
          <redirect view-id="/welcome.xhtml" />
         </rule>
        <rule if-outcome="false">
          <redirect view-id="/sorry.xhtml" />
        </rule>
      </navigation>
      </page>
      


      However when render of email fails (e.g. no connection to mailer) request renderer doesn't redirect me anywhere, stops on register.xhtml. It seems like it's 'broken' and stops processing current request. It turns to me that render of an email must succeed, otherwise your 'page renderer' dies? Does anyone know explanation of this?