On 1/23/06, Jason Vincent <[EMAIL PROTECTED]> wrote:
> 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".

OK, that implies that the redirect did indeed work.  (It's also
possible to do this sort of "is the user logged on" checking with a
PhaseListener, so you don't have to embed it in every view controller,
but let's not complicate the diagnosis by changing that just yet :-).

>  /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?
>

Yes, that is true ... More precisely, JSF navigation doesn't happen
until after a submit fires off one of your action methods, and it
returns a logical outcome string.  In the case at hand, we would be
waiting for the button handling the submit of the logon form to say
what outcome happened.

> 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.

There *is* a set of errors in your navigation rules ... view
identifiers should be using the JSP extension, not the JSF_mapped one.
 For example:

  <from-view-id>/login/login.jsp</from-view-id>

since that is the "real" page that did the rendering.  Same thing goes
for <to-view-id> settings.


> Jason

Craig

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

Reply via email to