Thanks for the response...

The url in the browser is changing to /login/login.jsf... I call the
redirect, from the the BaseViewController.prerender method...        
externalContext.redirect(toUrl); where in my case the toUrl is
"/cpt/login/login.jsf".  /cpt is my application context.

        ExternalContext externalContext = getExternalContext();
        String webappPath = externalContext.getRequestContextPath();
        String toUrl = webappPath+url;
        externalContext.redirect(toUrl);

I was under the impression that navigation rules don't come into play
until some commandLink or commandBotton is clicked.  Is that not true?

But, I think my navigation rules are indeed wrong. Which may explain
why the login button isn't going anywhere.  Here are my current
navigation rules...

    <navigation-rule>
        <from-view-id>*</from-view-id>
        <navigation-case>
            <from-outcome>home</from-outcome>
            <to-view-id>/home.jsf</to-view-id>
            <redirect/>
        </navigation-case>
    </navigation-rule>


    <navigation-rule>
        <from-view-id>/login/login.jsf</from-view-id>
        <navigation-case>
            <from-outcome>success</from-outcome>
            <to-view-id>/home.jsf</to-view-id>
        </navigation-case>
        <navigation-case>
            <from-outcome>failed</from-outcome>
            <to-view-id>/login/logon.jsf</to-view-id>
            <redirect/>
        </navigation-case>
    </navigation-rule>

Thanks so much.
Jason










On 1/23/06, Craig McClanahan <[EMAIL PROTECTED]> wrote:
> Inline ...
>
> On 1/23/06, Jason Vincent <[EMAIL PROTECTED]> wrote:
> > Hey there,
> >
> > I've got some unexpected navigation stuff going on, that I was hoping
> > someone can help explain.
> >
> > Here is my use-case:
> > 1) Home page is requested.
> > 2) user isn't logged in, so redirect to login url.
> > 3) after login, navigate to home.
> >
> > In my logs, I'm seeing this behavior, which is wierd... This is just
> > the initial request to the home page, I didn't hit the login button,
> > just yet.
> >
> > HomeVC.init(), requestURI=/cpt/home.jsf
> > HomeVC.prerender(), requestURI=/cpt/home.jsf
> > BaseViewController - /cpt/home.jsf is a secure url and not logged in,
> > redirecting to login: /login/login.jsf
> > HomeVC.destroy(), requestURI=/cpt/home.jsf
> > HomeVC.init(), requestURI=/cpt/home.jsf
> > HomeVC.prerender(), requestURI=/cpt/home.jsf
> > BaseViewController - /cpt/home.jsf is a secure url and not logged in,
> > redirecting to login: /login/login.jsf
> > HomeVC.destroy(), requestURI=/cpt/home.jsf
> >
> > The init,prerender,destroy are not called for LoginVC - Why not?
> >
>
> This is definitely wierd, all right.  It looks like the redirect from
> "/cpt/home.jsf" to "/login/login.jsf" did not actually happen ...
> instead it seems to have redisplayed the home page again.  How are you
> actually doing the redirect?
>
> One other quick thing to check ... in your server's log messages, do
> you see any warning messages that look like this?
>
>     WARNING:  No ViewController for viewId /foo/bar.jsf found under name baz
>
> If you do, its a sign that your view controller managed beans are not
> named as Shale is expecting them ("cpt$home" and "login$login" for the
> paths you are listing above).
>
> Craig
>
>
> > The wierd part is that the browser behavior is working as expected -
> > up to a point.
> > Once I hit the login button, the user is logged in, but the navigation
> > rule in faces-config, isn't sending the browser to the home url.
> >
> > Another interesting thing... after the login form is displayed, and I
> > Manually enter the login URL - the init,prerender, and destroy methods
> > are not called by ANY ViewController.
> >
> > PS... I do have no-cache meta tags in the jsps, and I also set the
> > headers in my baseViewControler.prerender method - so at least the
> > browser shouldn't be caching anything.
> >
> > Can anyone explain what is going on?
> >
> > Any help is appreciated.
> > Thanks,
> > Jason
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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

Reply via email to