4 Replies Latest reply on Jun 10, 2009 1:51 PM by xanthor

    mail renderer

    xanthor

      Hey there


      Im building a small application that is supposed to send mails, this application is meant to be callable from a couple of service applications we have here. One of our leaddevelopers came up with the idea of using the seam mail renderer for this. So i tried using it but i run into a problem. This is not meant to be part of a Web/JSF application and the only thing out of the seamframework we need is this renderer to render templated mails. Now after reading this forum it looks to me as if we need to have a running JSF-lifecycle to use the renderer.


      The injection of the Renderer is not happening and thats where my problem is, is there any way to get my hands on the renderer without a JSF lifecycle?


      here is how i try to use the renderer, setting the context variables for the template happens in an other class and once those are set the send()-method you see below is called. I feel like im missing something very obvious so any help would be appreciated




      @In(create=true)
      private Renderer renderer;
           
      
      public void send(){
           renderer.render("META-INF/simple.xhtml");
      }



        • 1. Re: mail renderer
          lvdberg

          A few things,


          - What a pity you're not using the rest of Seam, and consider if it's word the effort to piggy-back the mega-beautiful Seam on top of your application. You could do it directly with java-mail in comination with another templating technology such as Velocity.


          If you still decide its word the effort, consider the following possibilities
          - Pass everything to the DB and have Seam pich that up with an aynchronous task,
          - Use JMS to send everything to Seam,
          - Use the LifeCycle class to use Seam components (just learned from the expert)


          Leo



          • 2. Re: mail renderer
            xanthor

            Thanks for the reply,


            Right now there is nothing else in the seamframework that is needed for this project (but other projects that are being build here use seam).


            I was allready thinking about turning to java-mail and after your comment im quite sure i'll really do that :).


            Thanks for your input

            • 3. Re: mail renderer
              lvdberg

              Darn....


              Sorry for that, hoepfully JBoss will not sue me for loosing a potential new customer....



              Leo


              • 4. Re: mail renderer
                xanthor

                dont worry ;) there will be other projects where seam might be just what I need :) Then i will be back again seeking advice, im sure of it.