Package org.apache.struts2.sitemesh
Class OldDecorator2NewStrutsDecorator
java.lang.Object
com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator
org.apache.struts2.sitemesh.OldDecorator2NewStrutsDecorator
- All Implemented Interfaces:
com.opensymphony.module.sitemesh.RequestConstants
,com.opensymphony.sitemesh.Decorator
- Direct Known Subclasses:
OldDecorator2NewStrutsFreemarkerDecorator
,OldDecorator2NewStrutsVelocityDecorator
public abstract class OldDecorator2NewStrutsDecorator
extends com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator
implements com.opensymphony.module.sitemesh.RequestConstants
Adapts a SiteMesh 2
Decorator
to a
SiteMesh 3 Decorator
.- Since:
- SiteMesh 3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.opensymphony.module.sitemesh.Decorator
Fields inherited from interface com.opensymphony.module.sitemesh.RequestConstants
DECORATOR, DISABLE_BUFFER_AND_DECORATION, MAXIMUM_OUTPUT_EXCEEDED_LENGTH, PAGE, ROBOT, SECONDARY_STORAGE_LIMIT
-
Constructor Summary
ConstructorsConstructorDescriptionOldDecorator2NewStrutsDecorator
(com.opensymphony.module.sitemesh.Decorator oldDecorator) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Gets the L18N encoding of the system.protected Locale
getLocale
(ActionInvocation invocation, freemarker.template.Configuration configuration) Returns the locale used for theConfiguration.getTemplate(String, java.util.Locale)
call.protected void
render
(com.opensymphony.sitemesh.Content content, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.ServletContext servletContext, com.opensymphony.sitemesh.webapp.SiteMeshWebAppContext webAppContext) Applies the decorator, creating the relevent contexts and delegating to the extended applyDecorator().protected abstract void
render
(com.opensymphony.sitemesh.Content content, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.ServletContext servletContext, ActionContext ctx) Applies the decorator, using the relevent contextsMethods inherited from class com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator
render
-
Field Details
-
oldDecorator
protected com.opensymphony.module.sitemesh.Decorator oldDecorator
-
-
Constructor Details
-
OldDecorator2NewStrutsDecorator
public OldDecorator2NewStrutsDecorator(com.opensymphony.module.sitemesh.Decorator oldDecorator) -
OldDecorator2NewStrutsDecorator
public OldDecorator2NewStrutsDecorator()
-
-
Method Details
-
render
protected abstract void render(com.opensymphony.sitemesh.Content content, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.ServletContext servletContext, ActionContext ctx) throws jakarta.servlet.ServletException, IOException Applies the decorator, using the relevent contexts- Parameters:
content
- The contentrequest
- The servlet requestresponse
- The servlet responseservletContext
- The servlet contextctx
- The action context for this request, populated with the server state- Throws:
jakarta.servlet.ServletException
IOException
-
render
protected void render(com.opensymphony.sitemesh.Content content, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.ServletContext servletContext, com.opensymphony.sitemesh.webapp.SiteMeshWebAppContext webAppContext) throws IOException, jakarta.servlet.ServletException Applies the decorator, creating the relevent contexts and delegating to the extended applyDecorator().- Specified by:
render
in classcom.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator
- Parameters:
content
- The contentrequest
- The servlet requestresponse
- The servlet responseservletContext
- The servlet contextwebAppContext
- The web app context- Throws:
IOException
jakarta.servlet.ServletException
-
getLocale
protected Locale getLocale(ActionInvocation invocation, freemarker.template.Configuration configuration) Returns the locale used for theConfiguration.getTemplate(String, java.util.Locale)
call. The base implementation simply returns the locale setting of the action (assuming the action implementsLocaleProvider
) or, if the action does not the configuration's locale is returned. Override this method to provide different behaviour, -
getEncoding
Gets the L18N encoding of the system. The default is UTF-8.
-