You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by "Sie, Yang" <ya...@fmr.com> on 2006/03/21 19:18:18 UTC

Use PageManager from a servlet


Hello all:

I am trying to use the page Manager from a servlet to create a folder. 

I am hitting an error saying that Subject is missing (
AbstractBaseElement.checkConstraints(): Missing Subject. ). 
The error happened when calling pageManager.updateFolder()   
It seemed that my auth Subject object didn't get recognized by the
AccessController.getContext() (ref: Subject subject =
Subject.getSubject(AccessController.getContext()); of
org.apache.jetspeed.om.page.psml.AbstractBaseElement.java)

JS2 ver. 2.1 Dev.

Please advise. Thank you.

---Yang


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Use PageManager from a servlet

Posted by Randy Watler <wa...@wispertel.net>.
To use the PageManager component from a servlet, one needs to setup the
subject manually. You need to access the Subject from the session and
use it in a doPrivilegedAs() context as in done in the
AbstractSecurityValveImpl.

HTH,

Randy  

On Tue, 2006-03-21 at 13:18 -0500, Sie, Yang wrote:
> 
> Hello all:
> 
> I am trying to use the page Manager from a servlet to create a folder. 
> 
> I am hitting an error saying that Subject is missing (
> AbstractBaseElement.checkConstraints(): Missing Subject. ). 
> The error happened when calling pageManager.updateFolder()   
> It seemed that my auth Subject object didn't get recognized by the
> AccessController.getContext() (ref: Subject subject =
> Subject.getSubject(AccessController.getContext()); of
> org.apache.jetspeed.om.page.psml.AbstractBaseElement.java)
> 
> JS2 ver. 2.1 Dev.
> 
> Please advise. Thank you.
> 
> ---Yang
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-user-help@portals.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org