« 返回到 Development

Page Rendering

Table of Contents [-]

    Pages are rendered via the following mechanism:

    1. Request comes in through MainServlet. Various attributes are stored in the session and request. The request attribute WebKeys.CURRENT_URL holds the currently requested path (stripped of protocol,host, and port)
    2. The "service pre action" handler com.liferay.portal.events.ServicePreAction is called, where the layout and theme to display are determined. The current layout is stored as a request attribute under the key WebKeys.LAYOUT. The other available layouts are stored as a request attribute under the key WebKeys.LAYOUTS. The theme to display is stored as a request attribute under the WebKeys.THEME key, and the color scheme to use is stored as the request attribute WebKeys.COLOR_SCHEME. The theme and color scheme are usually determined by querying the layout once it has been determined.
    3. Struts is called to handle the request, and Liferay uses the custom Struts request processor com.liferay.portal.struts.PortalRequestProcessor. The PortalRequestProcessor.getLastPath() method computes the last path visited, and supplies a default path for the first entry into the portal. The default path upon entry into the portal is <protocol>://<hostName>:<port>/portal/layout. This url may optionally contain the query parameters ?p_l_id=default if the user is known (i.e. they have just logged in).
    4. This initial request for /portal/layout is handled by com.liferay.portal.action.LayoutAction.
    5. /html/common/themes/portal.jsp is the "top level" display page. It selects...
    6. the portal_normal.jsp or portal_pop_up.jsp based on the current state of the theme's display, and includes it using the <liferay-theme:include> custom tag, implemented by com.liferay.taglib.theme.IncludeTag, which in turn calls com.liferay.taglib.util.ThemeUtil.include().
    7. Eventually, for each portlet, the method com.liferay.portal.util.PortalUtil.renderPortlet() gets called, which calls
    8. /portal/portal-web/docroot/html/portal/render_portlet.jsp to render the contents of an individual portlet. That in turn calls
    9. /portal/portal-web/docroot/html/common/themes/portlet.jsp, which ends up calling
    10. /portal/portal-web/docroot/html/common/themes/portlet_content.jsp
    0 附件
    39871 查看
    平均 (2 票)
    满分为 5,平均得分为 5.0。
    评论
    讨论主题回复 作者 日期
    When a Hook define a custom Servlet Service... Denis Signoretto 2013年3月27日 上午5:13
    Custom Servlet Service Event Pre Action defined... Igor Beslic 2014年10月25日 下午3:38
    Great... but... why (in LR6) "render" phase is... Pierpaolo Cira 2013年10月7日 上午1:02

    When a Hook define a custom Servlet Service Event Pre Action, where the action is inserted? before or after the actions chain specified by servlet.service.events.pre property?
    在 13-3-27 上午5:13 发帖。
    Great... but... why (in LR6) "render" phase is called twice when a not-default theme is used?
    在 13-10-7 上午1:02 发帖。
    Custom Servlet Service Event Pre Action defined by hook are executed after portal's servlet.service.events.pre actions.
    在 14-10-25 下午3:38 发帖以回复 Denis Signoretto