Hi all,

I got the code below from the JSF spec, and it works fine except for the fact that I don't know how to put values recieved from the query string of a servlet into my Managed beans so that they are displayed when the first page initially comes up.  In fact, I can't get a childCount from the UIViewRoot component till after the call to lifecycle.render(), which calls the render response phase, which is the last phase in the cycle.

Any help is much appreciated.

-Elam


---------------------

public class RedirectServlet extends HttpServlet {

       protected void doGet( HttpServletRequest request, HttpServletResponse response) {
          
LifecycleFactory lifecycleFactory = (LifecycleFactory) FactoryFinder.getFactory(
                       FactoryFinder.LIFECYCLE_FACTORY);
           Lifecycle lifecycle = lifecycleFactory.getLifecycle(
                   LifecycleFactory.DEFAULT_LIFECYCLE);

           FacesContextFactory facesContextFactory =
               (FacesContextFactory) FactoryFinder.getFactory(
                       FactoryFinder.FACES_CONTEXT_FACTORY);
           FacesContext facesCtx = facesContextFactory.getFacesContext( getServletContext(),
                   request, response, lifecycle);
          
                      // Create new view

                      // 2.4.2.1
           Application app = facesCtx.getApplication();
           ViewHandler viewHdlr = app.getViewHandler();
           UIViewRoot viewRoot = viewHdlr.createView( facesCtx, requestedView);
                      // 2.4.2.2: we accept the default renderkit
                      // 2.4.2.3: we'll let Faces handle the
                      //   component tree

                      // 2.4.2.4: store view into context
           facesCtx.setViewRoot( viewRoot);
           lifecycle.render( facesCtx);

Reply via email to