Depends on when the backing bean is instantiated. If you are already
in the middle of rendering a view, I think this will cause problems
(what you are probably seeing), because all the phases are already
complete. If you are trying to navigate to another page during the
load of a page, I have an on-load component:

http://jsf-comp.sf.net

Look under the "OnLoad" component documentation. This will allow you
to invoke an action method on a backing bean right before the render
response phase.

-Andrew

On 2/22/06, Dudu <[EMAIL PROTECTED]> wrote:
> Is it possible tu handle a navigation in the constructor of a managed
> bean???
> I code like this but without success
>
> public class Atah {
>    public Atah(){
>       navegaProMódulo();
>       tentadenovo();
>    }
>
>    private void navegaProMódulo() {
>          FacesContext fc = FacesContext.getCurrentInstance();
>          UIViewRoot vw  =
> fc.getApplication().getViewHandler().createView(fc,"/sag/chooseModule.jsp");
>          fc.setViewRoot(vw);
>          fc.responseComplete();
>     }
>     private void tentaDenovo(){
>              FacesContext fc = FacesContext.getCurrentInstance();
>
> fc.getApplication().getNavigationHandler().handleNavigation(fc,null,"chooseModule");
>     }
> }
>

Reply via email to