Search in sources :

Example 1 with RenderingException

use of org.craftercms.engine.exception.RenderingException in project engine by craftercms.

the class CrafterPageView method renderActualView.

protected void renderActualView(String pageViewName, Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception {
    View actualView = delegatedViewResolver.resolveViewName(pageViewName, locale);
    if (actualView == null) {
        throw new RenderingException("No view was resolved for page view name '" + pageViewName + "'");
    }
    if (actualView instanceof AbstractView) {
        ((AbstractView) actualView).setContentType(getContentType());
    }
    actualView.render(model, request, response);
}
Also used : AbstractView(org.springframework.web.servlet.view.AbstractView) RenderingException(org.craftercms.engine.exception.RenderingException) AbstractView(org.springframework.web.servlet.view.AbstractView) View(org.springframework.web.servlet.View)

Example 2 with RenderingException

use of org.craftercms.engine.exception.RenderingException in project engine by craftercms.

the class UserAgentAwareCrafterPageView method renderActualView.

@Override
protected void renderActualView(String pageViewName, Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception {
    String userAgentSpecificPageViewName = userAgentTemplateDetector.resolveAgentTemplate(request, pageViewName);
    View actualView = delegatedViewResolver.resolveViewName(userAgentSpecificPageViewName, locale);
    if (actualView == null) {
        actualView = delegatedViewResolver.resolveViewName(pageViewName, locale);
        if (actualView == null) {
            throw new RenderingException("No view was resolved for page view name '" + pageViewName + "'");
        }
    }
    actualView.render(model, request, response);
}
Also used : RenderingException(org.craftercms.engine.exception.RenderingException) View(org.springframework.web.servlet.View)

Aggregations

RenderingException (org.craftercms.engine.exception.RenderingException)2 View (org.springframework.web.servlet.View)2 AbstractView (org.springframework.web.servlet.view.AbstractView)1