Liferay is a Gartner Magic Quadrant Leader for the Sixth Year! Find out why
« Back to 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 Attachments
    34415 Views
    Average (2 Votes)
    The average rating is 5.0 stars out of 5.
    Comments
    Threaded Replies Author Date
    When a Hook define a custom Servlet Service... Denis Signoretto March 27, 2013 5:13 AM
    Custom Servlet Service Event Pre Action defined... Igor Beslic October 25, 2014 3:38 PM
    Great... but... why (in LR6) "render" phase is... Pierpaolo Cira October 7, 2013 1:02 AM

    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?
    Posted on 3/27/13 5:13 AM.
    Great... but... why (in LR6) "render" phase is called twice when a not-default theme is used?
    Posted on 10/7/13 1:02 AM.
    Custom Servlet Service Event Pre Action defined by hook are executed after portal's servlet.service.events.pre actions.
    Posted on 10/25/14 3:38 PM in reply to Denis Signoretto.