【问题标题】:How can I set PortletSession in JSP page in Liferay MVC?如何在 Liferay MVC 的 JSP 页面中设置 PortletSession?
【发布时间】:2012-09-04 05:19:51
【问题描述】:

在 Liferay MVC 项目中,如何在 JSP 页面中设置 portletSession 并在自定义操作类中检索 portletSession

【问题讨论】:

    标签: jsp content-management-system liferay-6


    【解决方案1】:

    在 JSP 中您不需要做任何事情,因为它是提供的对象之一:

    <%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
    <portlet:defineObjects />
    <%
        portletSession.getAttribute(...);
    %>
    

    从一个类也不是什么大不了的事,它在你的渲染或动作方法中可用:

    PortletSession portletSession = actionRequest.getPortletSession(); // action method
    PortletSession portletSession = renderRequest.getPortletSession(); // render method
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-02
      • 1970-01-01
      • 1970-01-01
      • 2012-06-26
      • 1970-01-01
      相关资源
      最近更新 更多