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

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

系統 1699 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元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 潞西市| 邵武市| 苏州市| 平阳县| 彭山县| 安宁市| 毕节市| 西乌珠穆沁旗| 读书| 平远县| 竹山县| 阳新县| 温泉县| 大关县| 宁陵县| 土默特右旗| 荔波县| 淄博市| 乌鲁木齐县| 府谷县| 鹤峰县| 呈贡县| 勃利县| 什邡市| 乌拉特前旗| 芒康县| 新巴尔虎右旗| 墨竹工卡县| 丽水市| 宁强县| 贵州省| 尖扎县| 宁武县| 益阳市| 清新县| 鹿邑县| 唐河县| 那坡县| 武城县| 长葛市| 福安市|