webtier@glassfish.java.net

Re: faces-config with from-outcome not being string fails with NullPointerException

From: Luc <useyour.mind_at_gmail.com>
Date: Thu, 29 May 2014 13:10:25 +0200

Hello,
Thanks for trying to reproduce.
I'm watching your attachment, but first thing I realized is that method
"SessionManager#isLoggedIn()" returns a "String" instead of a "boolean".

Which I didn't told is that I'm not deploying to a Glassfish, but to a
Tomcat 6. But I make your attachment a deployable Tomcat webapp, and
effectively (although there are other problems) it works as expected even
with "boolean" return.

There are two more differences between attachment and my application (which
again, I didn't told >.< sorry):
- the beans are not "faces managed beans" and are instead CDI managed beans
(@SessionScoped + @Named)
- the new JSF tag "f:viewAction".

I will try later if with the new tag in my application or/and the
attachment webapplication with CDI, if are the causing problems.

Thanks again,
--
Lucas
2014-05-27 23:41 GMT+02:00 Edward Burns <edward.burns_at_oracle.com>:
> >>>>> On Mon, 26 May 2014 12:14:18 +0000 (UTC), <useyour.mind_at_gmail.com>
> said:
>
> UM> (I've posted this too @stackoverflow:
> UM> http://stackoverflow.com/q/23776638/1099452)
>
> UM> I've been using JSF 2.1 with mojarra-2.1.20, and I've configured in my
> UM> faces-config.xml a navigation case like this:
>
> UM> <navigation-rule>
> UM>     <from-view-id>/loggedOut.xhtml</from-view-id>
> UM>     <navigation-case>
> UM>     <from-action>#{sessionManager.isLoggedIn}</from-action>
> UM>     <from-outcome>true</from-outcome>
> UM>     <to-view-id>/login.xhtml</to-view-id>
> UM>     <redirect />
> UM>     </navigation-case>
> UM> </navigation-rule>
>
> Hello, thanks for reporting this.
>
> I'm trying to reproduce it and have not been able to.  Please find
> attached a simple maven pom project that I build following your sketch.
>
> Can you please try it in your environment and see if it shows the
> problem?  It does not show the problem in my environment.
>
> I tried the attached with both Mojarra 2.2.6 and 2.2.7-SNAPSHOT by
> visiting
> <
> http://localhost:8080/test-agnostic-navigation-explicit/faces/loggedOut.xhtml
> >,
> which has the <f:viewAction> that invokes your <navigation-rule> and in
> both cases it successfully redirects to /login.xhtml.
>
> Perhaps I'm missing something.
>
> Please try the attached.
>
> Thanks,
>
> Ed
>
> --
> | edward.burns_at_oracle.com | office: +1 407 458 0017
>
>