0 Replies Latest reply on Apr 16, 2012 8:15 AM by Akhbar Falafel

    Seam Mail -- Inline Image Issues

    Akhbar Falafel Newbie

      I'm trying to send an HTML e-mail with inline image attachments per the directions in the Seam 2.2 documentation.  In my e-mail XHTML file, I have the following lines to attach the image and then display it within the message:


      <m:attachment contentType="image/png"
      ="dwx_logo.png" value="#{imageData}"
      ="logoImage" disposition="inline" />
      <img src="cid:#{logoImage.contentId}" alt="logo header"
      ="no" style="margin: 0px; padding: 0px; display: block;" />


      However, when I render the message with this code:


      private Renderer renderer = null;


      String messageTemplate = ...



      I get the following exception...



      Caused by: java.lang.NullPointerException at org.jboss.seam.mail.ui.UIBody.encodeChildren(UIBody.java:79) at org.jboss.seam.ui.util.JSF.renderChild(JSF.java:175) at org.jboss.seam.ui.util.JSF.renderChildren(JSF.java:163) at org.jboss.seam.mail.ui.UIMessage.encodeChildren(UIMessage.java:192) at org.jboss.seam.ui.util.JSF.renderChild(JSF.java:175) at org.jboss.seam.ui.util.JSF.renderChildren(JSF.java:163) at org.jboss.seam.ui.facelet.RendererRequest.renderFacelet(RendererRequest.java:140) at org.jboss.seam.ui.facelet.RendererRequest.run(RendererRequest.java:107) at org.jboss.seam.ui.facelet.FaceletsRenderer.render(FaceletsRenderer.java:43)


      I have also tried removing the "disposition=inline" line, at which point the code works as expected. It just doesn't render the image inline, which defeats the purpose. Any idea why setting the disposition attribute value causes this exception? Is this a bug in Seam Mail? Or am I doing something wrong in my code?  I have tried both Seam 2.2 and Seam 2.3beta1 but get the same results with both versions.

      Thanks in advance for any help!