On 8/22/05, Rick Reumann <[EMAIL PROTECTED]> wrote:
> Craig McClanahan wrote the following on 8/22/2005 12:50 PM:
> 
> > It doesn't ... if you want to fire the standard request processing
> > lifecycle, you need to actually submit the request.  Using
> > <jsp:forward page="/foo.faces"/> will cause "/foo.jsp" to be rendered
> > (assuming you are using the standard extension mappings), entering the
> > JSF lifecycle at the Render Response phase.
> >
> > What problem are you trying to solve with <jsp:forward> that can't be
> > solved a different way?
> 
> What I'm trying to figure out is the best way to handle setting up an
> initial page when someone goes to the welcome page defined in web.xml
> (ie index.jsp). What's the best way to handle this? On page 20 of Core
> JSF they give the example of doing something like <jsp:forward
> page="/index.faces"/> but I don't see how this would ever trigger a
> method in my backing bean?
> 

It won't.  Only a form submit will trigger those method calls.

> For example, in this sample CRUD app I was wanting to load a list of
> employees right away that would show up on "employees.jsp"  I'm keeping
> this simple and will make this call to getEmployees in my
> EmployeeBacking bean, but I'm unclear about the best using JSF to fire
> this method and forward to the appropriate page when the user simply
> goes to foobarApp/index.jsp ?

Grab Shale.  Make your backing bean implement ViewController.  Stick
the list setup logic in the prerender() method.  Smile, knowing that
this technique works not only for the welcome page, but for *any* page
to which you navigate (in Struts Classic terms, this is the kind of
thing that you use a Controller for in Tiles).  :-)

If you wanted to do it the hard way, you could set things up to
register a phase listener, and call your list setup logic in a "before
render response" event handler ... but that's the part Shale takes
care of for you.

> 
> Thanks for the help
> 
> --
> Rick

Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to