日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

WebSphere Portal獲取當前登錄用戶名的三種方式

系統 1812 0

方法一:采用Portal的Puma API

Java代碼 復制代碼
  1. Context?ctx?=? new ?InitialContext(); ??
  2. PortletServiceHome?pumaServiceHome?=?(PortletServiceHome)?ctx.lookup( "portletservice/com.ibm.portal.um.portletservice.PumaHome" );??????????????? ??
  3. PumaHome?puma_home?=? null ;?????????????? ??
  4. if ?(pumaServiceHome?!=? null ){ ??
  5. ???????? ??
  6. ????puma_home?=?(PumaHome)?pumaServiceHome.getPortletService(PumaHome. class ); ??
  7. } ??
  8. PumaProfile?pp?=?puma_home.getProfile(); ??
  9. User?user?=?pp.getCurrentUser(); ??
  10. String?uid?=?pp.getIdentifier(user);???
    Context ctx = new InitialContext();
PortletServiceHome pumaServiceHome = (PortletServiceHome) ctx.lookup("portletservice/com.ibm.portal.um.portletservice.PumaHome");				
PumaHome puma_home = null;				
if (pumaServiceHome != null){
		
	puma_home = (PumaHome) pumaServiceHome.getPortletService(PumaHome.class);
}
PumaProfile pp = puma_home.getProfile();
User user = pp.getCurrentUser();
String uid = pp.getIdentifier(user); 
  

?

方法二:采用傳統的Request方式

Java代碼 復制代碼
  1. request.getUserPrincipal().getName();??或 request.getRemoteUser();
    request.getUserPrincipal().getName();
  
    ?request.getRemoteUser();
  

?

方法三:采用Taglib方式

Java代碼 復制代碼
  1. <%@?taglib?uri= "http://www.ibm.com/xmlns/prod/websphere/portal/v6.0/portal-fmt" ?prefix= "portal-fmt" ?%>? ??
  2. <portal-fmt:user?attribute= "cn" />??

WebSphere Portal獲取當前登錄用戶名的三種方式


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!?。?/p>

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 黄骅市| 海丰县| 涿鹿县| 阳山县| 柞水县| 遵义市| 扶沟县| 聊城市| 六枝特区| 潮州市| 曲阳县| 台东市| 滁州市| 平南县| 临沭县| 大余县| 齐河县| 海晏县| 南川市| 永川市| 紫阳县| 荔波县| 天柱县| 板桥市| 长葛市| 大方县| 句容市| 日喀则市| 茌平县| 筠连县| 舞阳县| 武鸣县| 湖州市| 福州市| 琼海市| 珠海市| 长兴县| 卢龙县| 吴堡县| 信阳市| 奉化市|