Search in sources :

Example 1 with NullPageDTO

use of org.broadleafcommerce.common.page.dto.NullPageDTO in project BroadleafCommerce by BroadleafCommerce.

the class PageHandlerMapping method getHandlerInternal.

@Override
protected Object getHandlerInternal(HttpServletRequest request) throws Exception {
    BroadleafRequestContext context = BroadleafRequestContext.getBroadleafRequestContext();
    if (context != null && context.getRequestURIWithoutContext() != null) {
        String requestUri = URLDecoder.decode(context.getRequestURIWithoutContext(), charEncoding);
        Boolean internalValidateFindPreviouslySet = false;
        PageDTO page;
        try {
            if (!BroadleafRequestContext.getBroadleafRequestContext().getInternalValidateFind()) {
                BroadleafRequestContext.getBroadleafRequestContext().setInternalValidateFind(true);
                internalValidateFindPreviouslySet = true;
            }
            page = pageService.findPageByURI(context.getLocale(), requestUri, buildMvelParameters(request), context.isSecure());
        } finally {
            if (internalValidateFindPreviouslySet) {
                BroadleafRequestContext.getBroadleafRequestContext().setInternalValidateFind(false);
            }
        }
        if (page != null && !(page instanceof NullPageDTO)) {
            context.getRequest().setAttribute(PAGE_ATTRIBUTE_NAME, page);
            return controllerName;
        }
    }
    return null;
}
Also used : NullPageDTO(org.broadleafcommerce.common.page.dto.NullPageDTO) PageDTO(org.broadleafcommerce.common.page.dto.PageDTO) BroadleafRequestContext(org.broadleafcommerce.common.web.BroadleafRequestContext) NullPageDTO(org.broadleafcommerce.common.page.dto.NullPageDTO)

Aggregations

NullPageDTO (org.broadleafcommerce.common.page.dto.NullPageDTO)1 PageDTO (org.broadleafcommerce.common.page.dto.PageDTO)1 BroadleafRequestContext (org.broadleafcommerce.common.web.BroadleafRequestContext)1