1 Reply Latest reply on May 19, 2008 10:51 PM by stephen

    Seam Mail does not work with current Seam and Trinidad versions

    stephen

      Seam and Trinidad are fighting a battle about the RenderingContext and my app looses :-(


      Seam uses a custom rendering context, see


      org.jboss.seam.ui.facelet.FaceletsRenderer:
      
         public String render(final String viewId) {
            RenderingContext context = new org.jboss.seam.ui.facelet.FaceletsRenderer.RenderingContext(viewId) {
               public void process() {
                  ...
               }
            };
            ...
         }
      



      And in org.jboss.seam.ui.facelet.FaceletsRenderer.RenderingContext:



            private void init() {
               // Wrap the ResponseWriter        
               facesContext.setResponseWriter(facesContext.getRenderKit().createResponseWriter(writer,                   null, null));



      The problem with that is that the RenderKit that is used here to create the ResponseWriter is org.apache.myfaces.trinidadinternal.renderkit.core.CoreRenderKit and that the createResponseWriter() method in that class expects a custom Trinidad RenderingContext:



        public ResponseWriter createResponseWriter(Writer writer, String contentTypeList, String characterEncoding) {
          ...      
            RenderingContext rc = org.apache.myfaces.trinidad.context.RenderingContext.getCurrentInstance();
            if (rc == null)
            {
              // TODO: is this always indicative of something being very wrong?
              _LOG.severe("No RenderingContext has been created.");
            }
            else
            {
              if (isPartialRequest(fContext.getExternalContext()))
                rw = new PPRResponseWriter(rw, rc);
            }
            ...
        }
      



      I mostly blame Trinidad for this issue (and will bring up the issue on their mailingt list), but is there any workaround on the Seam side. Seam is much more flexible with its overridable component architecture and more open minded community.

        • 1. Re: Seam Mail does not work with current Seam and Trinidad versions
          stephen

          Gosh, I was just too stupid.


          E-Mail did no longer worked and I found an error No RenderingContext has been created. in the log, so I assumed this to be the cause.


          However it's really only a message than can be ignored.


          The real cause was that while migrating from Trinidad 1.0.6/Seam 1.2.1 to Trinidad 1.2.7/Seam 2.0.2 I somehow lost the jboss-seam-mail.jar.


          There could better have been a message from Seam about missing classes/components, though.