Did you try to replace getLoggedIn() by isLoggedIn()?

2007/6/28, Bastian Voigt <[EMAIL PROTECTED]>:

Oh I forgot to say that all this was working with Tap 4.1.1

Bastian Voigt wrote:
> Hi *,
>
> we have the following problem with both OGNL 2.7.0 and OGNL
> 2.7.1-20070625 on Tap 4.1.2 with a construct like this:
>
> ------------html--------------
> <div jwcid="@If" condition="ognl: !loggedIn or
> !user.hasPermission(@[EMAIL PROTECTED])">
>    You do not have the permission for this!
> </div>
> ------------java--------------
> @InjectStateFlag("loginData")
> public abstract boolean getLoggedIn();
>   @InjectState("loginData")
> public abstract LoginSession getUser();
> -------------------------------
>
> Right after deployment, we are of course not logged in, so !loggedIn
> should be true and hasPermission should never be called! and
> getLoggedIn does indeed return false if you call it from the Java code!.
>
> However, in OGNL it seems to be false or whatever, because we get an
> exception saying "hasPermission" was called on a non-existing object.
>
> 1. We tried the following:
> <div jwcid="@If" condition="ognl: true or
> !user.hasPermission(@[EMAIL PROTECTED])">
>    You do not have the permission for this!
> </div>
> -> this works (hasPermission is NOT called, so no exception)
>
> 2. We also tried:
> <div jwcid="@If" condition="ognl:
> !user.hasPermission(@[EMAIL PROTECTED]) or !loggedIn">
>    You do not have the permission for this!
> </div>
> -> same exception
>
> 3. And then we tried:
> <div jwcid="@If" condition="ognl: (!loggedIn) or
> (!user.hasPermission(@[EMAIL PROTECTED]))">
>    You do not have the permission for this!
> </div>
> -> same exception
>
>
> Is this a bug in OGNL, or in Tapestry? How can I find this out?
>


--
Bastian Voigt
Neumünstersche Straße 4
20251 Hamburg
telefon +49 - 40  - 67957171
mobil   +49 - 179 - 4826359



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


Reply via email to