Skip to main content

developerWorks >  WebSphere  >  Forums  >  Portal and Portlet Development  >  developerWorks

WPS 5.0 JSR 168 JSF Portlet getting logged in username?    Point your RSS reader here for a feed of the latest messages in this thread


     

 
 

My developerWorks
 Welcome, Guest
Sign in or register
This question is not answered.

Permlink Replies: 1 - Pages: 1 - Last Post: Nov 23, 2009 10:34 AM Last Post By: jwbarnes Threads: [ Previous | Next ]
_SerpentOS

Posts: 25
Registered: Dec 13, 2004 09:12:09 AM
WPS 5.0 JSR 168 JSF Portlet getting logged in username?
Posted: Nov 04, 2009 09:08:43 PM
 
Click to report abuse...   Click to reply to this thread Reply
Hi,
While building a JSR 168 JSF portlet on WPS 5.0 I'm unable to get the logged in username.

I can't find documentation on where the user information is stored, comparing it to Struts portlets I have something like this in struts version

String userId = pRequest.getUser().getUserID();


Where pRequest is an instance of

org.apache.jetspeed.portlet.PortletRequest


however I'm in search for a comparable parameter in JSF version and I don't seem to find any.

Out of desperation I'm listing the output of my attempts here,

all marked with ##########MASKED######### are application specific and insignificant

ExternalContext.getUserPrinicipal() : null
ExternalContext.getRemoteUser: null;

ExternalContext.Maps
O ###########Dumping Map: RequestHeaderMap
O Key <accept-language> Value <en-us,en;q=0.5>
O Key <wps.markup> Value <html>
O Key <content-type> Value <application/x-www-form-urlencoded>
O Key <accept-encoding> Value <gzip,deflate>
O Key <user-agent> Value <Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) Gecko/20091016 Firefox/3.5.4 (.NET CLR 3.5.30729)>
O Key <cookie> Value <GUEST_LANGUAGE_ID=en_US; COOKIE_SUPPORT=true; LOGIN=6272756e6f4037636f67732e636f6d; SCREEN_NAME=6d6a4b4a6a616e795670303d; JSESSIONID=0000j5WQt_ktcoGWq-5uqVLAQ20:-1>
O Key <content-length> Value <359>
O Key <accept-charset> Value <ISO-8859-1,utf-8;q=0.7,*;q=0.7>
O Key <connection> Value <keep-alive>
O Key <host> Value <localhost:9081>
O Key <accept> Value <text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8>
O Key <referer> Value <http://localhost:9081/wps/myportal/!ut/p/_s.7_0_A/7_0_1A95?cID=6_0_3S&nID=7_0_5L>
O Key <keep-alive> Value <300>
O ########################################
O ###########Dumping Map: RequestMap
O Key <DEFAULT> Value <com.sun.faces.lifecycle.LifecycleImpl@6af56af5>
O Key <com.ibm.faces.FACES_CONTEXT> Value <com.ibm.faces.context.PortletFacesContextImpl@15841584>
O Key <varuserList> Value <##########MASKED#########@623d623d>
O Key <com.ibm.faces.CONTEXT_FACTORY> Value <com.ibm.faces.context.PortletFacesContextFactoryImpl@5d635d63>
O Key <pc_##########MASKED#########> Value <pagecode.##########MASKED#########@67586758>
O Key <com.ibm.faces.LIFECYCLE_FACTORY> Value <com.sun.faces.lifecycle.LifecycleFactoryImpl@8580858>
O Key <javax.portlet.userinfo> Value <null>
O Key <com.ibm.faces.webapp.PortletConstants_LIFECYCLE_RUN> Value <com.ibm.faces.webapp.PortletConstants_LIFECYCLE_RUN>
O ########################################
O ###########Dumping Map: SessionMap
O Key <javax.portlet.p.7_0_1A9A?javax.faces.request.charset> Value <null>
O Key <javax.portlet.p.7_0_1A9A?com.sun.faces.VIEW_LIST> Value <null>
O Key <javax.portlet.p.7_0_1A9B?com.ibm.faces.portlet.page.view> Value <null>
O Key <javax.portlet.p.7_0_1A9A?sessionBean> Value <null>
O Key <javax.portlet.p.7_0_1A9A?com.ibm.faces.portlet.page.view> Value <null>
O Key <javax.portlet.p.7_0_1A9B?com.ibm.faces.portlet.CURRENT_PORTLET_ID> Value <null>
O Key <javax.portlet.p.7_0_1A9A?com.ibm.faces.portlet.CURRENT_PORTLET_ID> Value <null>
O Key <javax.portlet.p.7_0_1A9A?/##########MASKED#########.jsp> Value <null>
O Key <javax.portlet.p.7_0_1A9B?/##########MASKED#########jsp> Value <null>
O Key <javax.portlet.p.7_0_1A9B?com.sun.faces.VIEW_LIST> Value <null>
O Key <javax.portlet.p.7_0_1A9B?javax.faces.request.charset> Value <null>
O Key <javax.portlet.p.7_0_1A9B?##########MASKED#########SessionBean> Value <null>
O ########################################
O ###########Dumping Map: RequestCookieMap
O ########################################
O ###########Dumping Map: InitParameterMap
O Key <com.ibm.ws.jsf.LOAD_FACES_CONFIG_AT_STARTUP> Value <true>
O Key <com.ibm.ws.jsf.JSP_UPDATE_CHECK> Value <true>
O ########################################
jwbarnes

Posts: 3,731
Registered: Sep 28, 2007 08:59:07 AM
Re: WPS 5.0 JSR 168 JSF Portlet getting logged in username?
Posted: Nov 23, 2009 10:34:35 AM   in response to: _SerpentOS in response to: _SerpentOS's post
 
Click to report abuse...   Click to reply to this thread Reply
you should be able to get the portletrequest from the faces context

RAD v7: com.ibm.faces.portlet.httpbridge.PortletRequestWrapper request =
(PortletRequestWrapper)FacesContext.getCurrentInstance().getExternalContext().getRequest();
javax.portlet.PortletRequest prequest = request.getPortletRequest();



IBM Certified System Administrator -- WebSphere Portal V6.0, V5.1, V5.0
IBM Certified Solution Developer -- WebSphere Portal V5.1, v6.0

The postings on this site are my own and do not necessarily represent the positions, strategies, or opinions of IBM

 Tags
Help

Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular type of content or application that you're viewing.

My tags shows your tags for this particular type of content or application that you're viewing.

 

MoreLess 


Point your RSS reader here for a feed of the latest messages in all forums