You could delegate a getPrincipal method like this on your Action:

public Principal getPrincipal() {
    return ActionContext.getContext().getPrincipal();
}

Then it would be available from your JSP as another property.

Jason

> -----Original Message-----
> From: Porter, Mike [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, July 08, 2003 12:02 PM
> To: [EMAIL PROTECTED]
> Subject: [OS-webwork] ww1.3 - ActionContext getPrincipal
> 
> 
> Hi,
> I am trying to determine if a user has been authenticated on 
> one of my pages.  I 'think' the 'best' way is to use the 
> ActionContext.getContext().getPrincipal() method. From an 
> Action class this works fine and dandy.
> 
> But from a JSP I had to put a little 'hack' into place to get 
> access to the Principal.  My jsp code is attached here.
> 
> <ww:bean name="'webwork.action.ActionContext'" id="actionContext">
>     <ww:if test="principal != null">
>         Principal <ww:property value="principal"/> is logged in
>     </ww:if>
> </ww:bean>>
> 
> Is there a better/easier/more direct way to call methods on 
> the ActionContext than doing what I just did??
> 
> Thanks,
> 
> Mike Porter
> 
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email sponsored by: Parasoft
> Error proof Web apps, automate testing & more.
> Download & eval WebKing and get a free book. 
> www.parasoft.com/bulletproofapps 
> _______________________________________________
> Opensymphony-webwork mailing list 
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
> 


-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to