[Tap 4.1.2] More OGNL problems

View: New views
4 Messages — Rating Filter:   Alert me  

[Tap 4.1.2] More OGNL problems

by Bastian Voigt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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


Re: [Tap 4.1.2] More OGNL problems

by Bastian Voigt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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


Re: [Tap 4.1.2] More OGNL problems

by Christian Dutaret-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

2007/6/28, Bastian Voigt <post@...>:

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

Re: [Tap 4.1.2] More OGNL problems

by Jessek :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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