On Oct 7, 2008, at 7:59 PM, pradeep reddy wrote:

I tried to use the following way to get the user name and password, but it is not working...
i bought this idea from login portlet.


FacesContext context = FacesContext.getCurrentInstance(); ExternalContext extcontext = context.getExternalContext(); RenderRequest request = (RenderRequest) extcontext.getRequest(); this.username = (String) ((RequestContext) request .getAttribute (RequestContext .REQUEST_PORTALENV )).getSessionAttribute(LoginConstants.USERNAME); this.password = (String) ((RequestContext) request .getAttribute (RequestContext .REQUEST_PORTALENV )).getSessionAttribute (LoginConstants.PASSWORD);System.out.println(username);

You can get the Subject from the RequestContext. I think we should also make this available via the Principal and casting to a known Jetspeed interface in 2.2, but that is not available yet
So here for a JSP for ex:

<%@ page import="org.apache.jetspeed.request.RequestContext"%>
RequestContext requestContext = (RequestContext)request.getAttribute(RequestContext.REQUEST_PORTALENV);
    Subject subject = requestContext.getSubject();

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to