cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Saskia Heesen" <saskia.hee...@gmx.de>
Subject Re: CoWarp: Loading Class ApplicationUtil
Date Tue, 12 Sep 2006 19:45:19 GMT
I found the solution:

User user = ApplicationUtil.getUser(getObjectModel());


-------- Original-Nachricht --------
Datum: Mon, 11 Sep 2006 23:14:09 +0200
Von: "Saskia Heesen" <saskia.heesen@gmx.de>
An: users@cocoon.apache.org
Betreff: CoWarp: Loading Class ApplicationUtil

> Hello
> 
> in my application, I'd like to check if the user has the appropriate role.
> There is a method isUserInRole() in the ApplicationUtil class from the
> cowarp package.
> 
> My first attempt was:
> 
> ApplicationUtil appUtil = new ApplicationUtil();
> if (appMan.isLoggedIn("Demo")){
>   User user = appUtil.getUser(); // Line no 39
> 
> I got an exception:
> 
> java.lang.NullPointerException
>         at
> org.apache.cocoon.components.ContextHelper.getObjectModel(ContextHelper.java:89)
>         at
> org.osoco.cowarp.ApplicationUtil.getUser(ApplicationUtil.java:99)
>         at org.test.auth.CFormsFlow.doQuadrat(CFormsFlow.java:39)
> 

-- 
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message