0
WebサービスコールでユーザーのprofilePicURLを取得したいとします。
私はそのユーザーのuserIdを持っています。私はSystem.out.println(themeDisplay)
をしたとき、私はLiferay:serviceImplクラスのThemeDisplayを使わないでuser profilePicURLを取得するには?
public String getProfilePicURL(long userId) throws SystemException,
PortalException {
String url = "";
ServiceContext serviceContext = ServiceContextThreadLocal
.getServiceContext();
ThemeDisplay themeDisplay = serviceContext.getThemeDisplay();
User user = UserLocalServiceUtil.getUser(userId);
try {
url = user.getPortraitURL(themeDisplay);
} catch (PortalException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
return url;
}
}
をしようとしています何
これは、それは私がこれを達成するための他の方法を知らないnull
として出てきました。
変更する必要はありますか?
ありがとうDevz、 ここでimagePathとは何ですか? 私はそこに何を渡すべきか分かりません。 ありがとう –
「/画像」です。 – Devz
こんにちはDevz、 私はそれを理解しました。 そして、私は 'themeDisplay.getPathImage()'を試みましたが、themeDisplay nullを取得しているのと同じ問題に戻ります。 –