0 Replies Latest reply on Oct 11, 2009 10:31 PM by Matthias Thiele

    Exception in Renderer.render()

    Matthias Thiele Newbie
      Hi all,

      I am having a very strange effect when sending emails with Seam. Everything is fine in the case that the email was sent OK. However, if any exception occurs in Renderer.render(), the JSF page blows up. It is hard to explain what happens because I do not see a pattern in it. The best description I can actually provide is that it somehow look "half rendered", e.g. CSS-includes are suddenly missing but also <s:link> tags are screwed.

      My code is very similar to the example from the reference, but I am invoking it in an Ajax request.

      My seam component (living in the Event scope):

      `@In(create = true)
      private Renderer renderer;

      ... (irrelevant stuff omitted)

      public void send(String template)
      {
         try
         {
             renderer.render(template);
             log.debug("Sending email from #0 <#1> to #2.", this.fromName,
                        this.fromAddress, this.toAddress);
             clearFields();
             this.isSent = true;
         }
         catch (Exception e)
         {
             this.isError = true;
             log.error(e);
             e.printStackTrace();
         }
      }
      `

      My JSF page contains this command button:

      `<a4j:commandButton reRender="contact_form,reply" action="#{sendSimpleEmailAction.send('/email/simple_email.xhtml')}" value="#{messages['faces.std.mainscreen.imprint.contact.send']}" />`
      contact_form and reply are both ids of aj4:outputPanels that shall be rerendered after sending email.

      Anybody an idea what I am doing wrong?

      Matt