org.broadleafcommerce.common.web
Class BroadleafThymeleafViewResolver
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.view.AbstractCachingViewResolver
org.thymeleaf.spring3.view.ThymeleafViewResolver
org.broadleafcommerce.common.web.BroadleafThymeleafViewResolver
- All Implemented Interfaces:
- org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.core.Ordered, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.ViewResolver
public class BroadleafThymeleafViewResolver
- extends org.thymeleaf.spring3.view.ThymeleafViewResolver
This class extends the default ThymeleafViewResolver to facilitate rendering
template fragments (such as those used by AJAX modals or iFrames) within a
full page container should the request for that template have occurred in a
stand-alone context.
- Author:
- Andre Azzolini (apazzolini)
| Fields inherited from class org.thymeleaf.spring3.view.ThymeleafViewResolver |
FORWARD_URL_PREFIX, REDIRECT_URL_PREFIX |
| Fields inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver |
DEFAULT_CACHE_LIMIT |
| Fields inherited from class org.springframework.context.support.ApplicationObjectSupport |
logger |
| Fields inherited from interface org.springframework.core.Ordered |
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
| Methods inherited from class org.thymeleaf.spring3.view.ThymeleafViewResolver |
addStaticVariable, canHandle, getCharacterEncoding, getContentType, getExcludedViewNames, getOrder, getStaticVariables, getTemplateEngine, getViewClass, getViewNames, isRedirectContextRelative, isRedirectHttp10Compatible, setCharacterEncoding, setContentType, setExcludedViewNames, setOrder, setRedirectContextRelative, setRedirectHttp10Compatible, setStaticVariables, setTemplateEngine, setViewClass, setViewNames |
| Methods inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver |
clearCache, getCacheKey, getCacheLimit, isCache, isCacheUnresolved, removeFromCache, resolveViewName, setCache, setCacheLimit, setCacheUnresolved |
| Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport |
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext |
| Methods inherited from class org.springframework.context.support.ApplicationObjectSupport |
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AJAX_REDIRECT_URL_PREFIX
public static final String AJAX_REDIRECT_URL_PREFIX
Prefix to be used in view names (returned by controllers) for specifying an
HTTP redirect with AJAX support. That is, if you want a redirect to be followed
by the browser as the result of an AJAX call or within an iFrame at the parent
window, you can utilize this prefix. Note that this requires a JavaScript component,
which is provided as part of BLC.js
If the request was not performed in an AJAX / iFrame context, this method will
delegate to the normal "redirect:" prefix.
Value: ajaxredirect:
- See Also:
- Constant Field Values
layoutMap
protected Map<String,String> layoutMap
fullPageLayout
protected String fullPageLayout
iframeLayout
protected String iframeLayout
BroadleafThymeleafViewResolver
public BroadleafThymeleafViewResolver()
canHandle
protected boolean canHandle(String viewName)
createView
protected org.springframework.web.servlet.View createView(String viewName,
Locale locale)
throws Exception
- Determines which internal method to call for creating the appropriate view. If no
Broadleaf specific methods match the viewName, it delegates to the parent
ThymeleafViewResolver createView method
- Overrides:
createView in class org.thymeleaf.spring3.view.ThymeleafViewResolver
- Throws:
Exception
loadAjaxRedirectView
protected org.springframework.web.servlet.View loadAjaxRedirectView(String redirectUrl,
Locale locale)
throws Exception
- Performs a Broadleaf AJAX redirect. This is used in conjunction with BLC.js to support
doing a browser page change as as result of an AJAX call.
- Parameters:
redirectUrl - locale -
- Returns:
-
- Throws:
Exception
loadView
protected org.springframework.web.servlet.View loadView(String originalViewName,
Locale locale)
throws Exception
- Overrides:
loadView in class org.thymeleaf.spring3.view.ThymeleafViewResolver
- Throws:
Exception
isIFrameRequest
protected boolean isIFrameRequest()
isAjaxRequest
protected boolean isAjaxRequest()
getLayoutMap
public Map<String,String> getLayoutMap()
- Gets the map of prefix : layout for use in determining which layout
to dispatch the request to in non-AJAX calls
- Returns:
- the layout map
setLayoutMap
public void setLayoutMap(Map<String,String> layoutMap)
- Parameters:
layoutMap - - See Also:
getLayoutMap()
getFullPageLayout
public String getFullPageLayout()
- The default layout to use if there is no specifc entry in the layout map
- Returns:
- the full page layout
setFullPageLayout
public void setFullPageLayout(String fullPageLayout)
- Parameters:
fullPageLayout - - See Also:
getFullPageLayout()
getIframeLayout
public String getIframeLayout()
- The layout to use for iframe requests
- Returns:
- the iframe layout
setIframeLayout
public void setIframeLayout(String iframeLayout)
- Parameters:
iframeLayout - - See Also:
getIframeLayout()
Copyright © 2013. All Rights Reserved.