DispatcherPortlet.java 文件源码

java
阅读 17 收藏 0 点赞 0 评论 0

项目:class-guard 作者:
/**
 * Perform a dispatch on the given PortletRequestDispatcher.
 * <p>The default implementation uses a forward for resource requests
 * and an include for render requests.
 * @param dispatcher the PortletRequestDispatcher to use
 * @param request current portlet render/resource request
 * @param response current portlet render/resource response
 * @throws Exception if there's a problem performing the dispatch
 */
protected void doDispatch(PortletRequestDispatcher dispatcher, PortletRequest request, MimeResponse response)
        throws Exception {

    // In general, we prefer a forward for resource responses, in order to have full Servlet API
    // support in the target resource (e.g. on uPortal). However, on Liferay, a resource forward
    // displays an empty page, so we have to resort to an include there...
    if (PortletRequest.RESOURCE_PHASE.equals(request.getAttribute(PortletRequest.LIFECYCLE_PHASE)) &&
            !dispatcher.getClass().getName().startsWith("com.liferay")) {
        dispatcher.forward(request, response);
    }
    else {
        dispatcher.include(request, response);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号