Portlet API 类型 | 配置对象 | 值绑定 |
---|---|---|
JSR 168 API | PortletPreferences | #{portletPreferences.attribute name} |
IBM portlet API | PortletApplicationSettings | #{portletApplicationSettings.attribute name} |
PortletSettings | #{portletSettings.attribute name} | |
PortletData | #{portletData.attribute name} |
使用 portlet JSP 文件的“页数据”视图来定义属性并将它们绑定至 Faces 组件,如在从 portlet JSP 文件访问配置对象中描述的那样。
PortletRequest request = (PortletRequest)facesContext.getExternalContext().getRequest(); PortletResponse response = (PortletResponse)facesContext.getExternalContext().getResponse(); PortletContext context = (PortletContext)facesContext.getExternalContext().getContext();
如果想要访问 Faces 操作的 IBM portlet API 中的 ActionEvent 类(org.apache.jetspeed.portlet.event.ActionEvent),可通过请求属性获取它:
ActionEvent event = (ActionEvent)facesContext.getExternalContext().getRequestMap().get("com.ibm.faces.portlet.ACTION_EVENT");