Re: Shale: not calling prerender or preprocess, and Navigation issue

2006-01-23 Thread Craig McClanahan
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...
>
> 
> *
> 
> home
> /home.jsf
> 
> 
> 
>
>
> 
> /login/login.jsf
> 
> success
> /home.jsf
> 
> 
> failed
> /login/logon.jsf
> 
> 
> 
>
> 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:

  /login/login.jsp

since that is the "real" page that did the rendering.  Same thing goes
for  settings.


> Jason

Craig

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



Re: Shale: not calling prerender or preprocess, and Navigation issue

2006-01-23 Thread Jason Vincent
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...


*

home
/home.jsf






/login/login.jsf

success
/home.jsf


failed
/login/logon.jsf




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]



Re: Shale: not calling prerender or preprocess, and Navigation issue

2006-01-23 Thread Craig McClanahan
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]



Shale: not calling prerender or preprocess, and Navigation issue

2006-01-23 Thread Jason Vincent
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?

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]