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

    Fields
    Modifier and Type
    Field
    Description
    protected 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

    Constructors
    Constructor
    Description
     
    OldDecorator2NewStrutsDecorator(com.opensymphony.module.sitemesh.Decorator oldDecorator)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected String
    Gets the L18N encoding of the system.
    protected Locale
    getLocale(ActionInvocation invocation, freemarker.template.Configuration configuration)
    Returns the locale used for the Configuration.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 contexts

    Methods inherited from class com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator

    render

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 content
      request - The servlet request
      response - The servlet response
      servletContext - The servlet context
      ctx - 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 class com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator
      Parameters:
      content - The content
      request - The servlet request
      response - The servlet response
      servletContext - The servlet context
      webAppContext - The web app context
      Throws:
      IOException
      jakarta.servlet.ServletException
    • getLocale

      protected Locale getLocale(ActionInvocation invocation, freemarker.template.Configuration configuration)
      Returns the locale used for the Configuration.getTemplate(String, java.util.Locale) call. The base implementation simply returns the locale setting of the action (assuming the action implements LocaleProvider) or, if the action does not the configuration's locale is returned. Override this method to provide different behaviour,
    • getEncoding

      protected String getEncoding()
      Gets the L18N encoding of the system. The default is UTF-8.