本文介绍了从liferay portlet访问用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为liferay开发一个portlet.

I'm attempting to develop a portlet for liferay.

如何获取当前登录用户的用户名和密码(以及liferay拥有的其他数据)?

How can I get access to the username and password (and other data liferay has) of the user that's currently logged in?

我还希望能够在用户更改密码时执行一些代码.

I'd also like to be able to execute some code when users change their password.

推荐答案

您可以通过调用.这是由JSR-168定义的,因此它是跨门户兼容的.

You can get the User ID by calling getRemoteUser() in the PortletRequest object. This is defined by JSR-168 therefore it's cross-portal compatible.

获得ID后,您可以通过调用 getUserById() (Liferay特定服务).这是Portlet API规范未涵盖的内容,因此将您锁定在Liferay.

Once you have the ID you can fetch the additional informations by calling getUserById() (a Liferay specific service). This is something not covered by Portlet API specification, so it locks you to the Liferay.

这篇关于从liferay portlet访问用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 09:46