« Return to Thread: [Tap 4.1.2] More OGNL problems

Re: [Tap 4.1.2] More OGNL problems

by Jessek :: Rate this Message:

Reply to Author | View in Thread

Not sure, can you file in http://jira.opensymphony.com/browse/OGNL just in
case?  I usually do them all in one batch so it's in everyones best interest
to get them in to jira asap.

On 6/28/07, Bastian Voigt <post@...> 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(@constants.Permissions@FOO)">
>     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(@constants.Permissions@FOO)">
>     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(@constants.Permissions@FOO) 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(@constants.Permissions@FOO))">
>     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: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>
>


--
Jesse Kuhnert
Tapestry/Dojo team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind. http://blog.opencomponentry.com

 « Return to Thread: [Tap 4.1.2] More OGNL problems