Portlet首选项

时间:2012-12-05 09:31:20

标签: jsf-2 liferay portlet

我正在尝试将portlet首选项存储在辅助bean(JSF)中,如tutorial中所述

但是,我无法理解他们如何在这里导入Preference类

Map<String, Preference> mutablePreferenceMap = (Map<String, Preference>) elResolver.getValue( facesContext.getELContext(), null, elExpression);

javax.portlet.*不包含faces.preference.Preference

任何人都有这个想法,特别是如何保存portlet首选项

提前致谢

1 个答案:

答案 0 :(得分:0)

您必须将Liferay Faces Bridge JAR添加到您的项目中。

添加以下依赖项:

<dependencies>
  <dependency>
    <groupId>com.liferay.faces</groupId>
    <artifactId>liferay-faces-alloy</artifactId>
    <version>3.1.0-ga1</version>
  </dependency>
  <dependency>
    <groupId>com.liferay.faces</groupId>
    <artifactId>liferay-faces-bridge-impl</artifactId>
    <version>3.1.0-ga1</version>
  </dependency>
  <dependency>
    <groupId>com.liferay.faces</groupId>
    <artifactId>liferay-faces-portal</artifactId>
    <version>3.1.0-ga1</version>
  </dependency>
</dependencies>

和liferay-faces-bridge-api jar是liferay-faces-bridge-impl的依赖,它有这个Preference接口。

更多信息:

http://www.liferay.com/community/liferay-projects/liferay-faces/download