3 Replies Latest reply on Feb 18, 2008 7:33 PM by pmuir

    Using org.jboss.seam.faces.Render from servlet

    mheath

      I'm trying to render some facelet templates from a servlet using org.jboss.seam.faces.Render.  Because I'm using a servlet, it fails.  The problem seams to be that it can't find my Facelet templates because it ends up using MockFacesContext which has a MockExternelContext which means that it ends up doing Class.getResource(...) instead of ServletContext.getResource(...) to try and find my facelet template.


      Any ideas on how I can fix this?

        • 1. Re: Using org.jboss.seam.faces.Render from servlet
          pmuir

          We need to review how the Renderer works e.g. the IceFaces Seam Mail compatibility issue - so keep an eye out for this!

          • 2. Re: Using org.jboss.seam.faces.Render from servlet
            gavin.king

            I guess if people are starting to need to use Renderer outside of JSF, then we should create a org.jboss.seam.facelets package with a Renderer class that can use non-JSF resource loading, and have org.jboss.seam.faces.Render extend it and override its resource loading to use the JSF ExternalContext.


            Alternatively, we could just change the implementation of MockExternelContext, but that seems a bit dirty, and it's kinda wrong to be using the org.jboss.seam.faces package when you're not using JSF...


            It's worth a feature request in JIRA.

            • 3. Re: Using org.jboss.seam.faces.Render from servlet
              pmuir

              I'm not quite sure what you mean - how can we use facelets outside of JSF?


              What we need to be doing is building a fuller JSF environment in which to execute the render.