Package org.craftercms.engine.controller
Class PageRenderController
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.support.WebContentGenerator
org.springframework.web.servlet.mvc.AbstractController
org.craftercms.engine.controller.PageRenderController
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,org.springframework.web.context.ServletContextAware,org.springframework.web.servlet.mvc.Controller
public class PageRenderController
extends org.springframework.web.servlet.mvc.AbstractController
Default controller for rendering Crafter pages. If the site context is the fallback context, a fallback page is
always rendered. The controller also tries to find a script controller for the page URL (when not fallback). If
one is found, it's executed and its return value is interpreted as a view name to be rendered.
- Author:
- Alfonso Vasquez, Dejan Brkic
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected Stringprotected Stringprotected PluginServiceprotected org.craftercms.core.service.ContentStoreServiceFields inherited from class org.springframework.web.servlet.support.WebContentGenerator
HEADER_CACHE_CONTROL, METHOD_GET, METHOD_HEAD, METHOD_POST -
Constructor Summary
ConstructorsConstructorDescriptionPageRenderController(String fallbackPageUrl, org.craftercms.core.service.ContentStoreService storeService) -
Method Summary
Modifier and TypeMethodDescriptioncreateScriptVariables(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, Map<String, Object> model) protected StringexecuteScript(Script script, Map<String, Object> scriptVariables) protected ScriptgetControllerScript(SiteContext siteContext, jakarta.servlet.http.HttpServletRequest request, String pageUrl) protected StringgetScriptUrl(SiteContext siteContext, ScriptFactory scriptFactory, jakarta.servlet.http.HttpServletRequest request, String pageUrl) protected org.springframework.web.servlet.ModelAndViewhandleRequestInternal(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) voidsetDisableVariableRestrictions(boolean disableVariableRestrictions) voidsetFallbackMessage(String fallbackMessage) voidsetPluginService(PluginService pluginService) Methods inherited from class org.springframework.web.servlet.mvc.AbstractController
handleRequest, isSynchronizeOnSession, setSynchronizeOnSessionMethods inherited from class org.springframework.web.servlet.support.WebContentGenerator
applyCacheControl, applyCacheSeconds, checkAndPrepare, checkRequest, getAllowHeader, getCacheControl, getCacheSeconds, getSupportedMethods, getVaryByRequestHeaders, isRequireSession, prepareResponse, setCacheControl, setCacheSeconds, setRequireSession, setSupportedMethods, setVaryByRequestHeadersMethods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextMethods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, initApplicationContext, obtainApplicationContext, requiredContextClass, setApplicationContext
-
Field Details
-
fallbackPageUrl
-
fallbackMessage
-
storeService
protected org.craftercms.core.service.ContentStoreService storeService -
disableVariableRestrictions
protected boolean disableVariableRestrictions -
pluginService
-
-
Constructor Details
-
PageRenderController
public PageRenderController(String fallbackPageUrl, org.craftercms.core.service.ContentStoreService storeService)
-
-
Method Details
-
setFallbackMessage
-
setDisableVariableRestrictions
public void setDisableVariableRestrictions(boolean disableVariableRestrictions) -
setPluginService
-
handleRequestInternal
protected org.springframework.web.servlet.ModelAndView handleRequestInternal(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws Exception - Specified by:
handleRequestInternalin classorg.springframework.web.servlet.mvc.AbstractController- Throws:
Exception
-
getControllerScript
protected Script getControllerScript(SiteContext siteContext, jakarta.servlet.http.HttpServletRequest request, String pageUrl) -
getScriptUrl
protected String getScriptUrl(SiteContext siteContext, ScriptFactory scriptFactory, jakarta.servlet.http.HttpServletRequest request, String pageUrl) -
createScriptVariables
-
executeScript
- Throws:
Exception
-