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

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected com.opensymphony.module.sitemesh.Decorator` | `oldDecorator`

    - ### Fields inherited from interface com.opensymphony.module.sitemesh.RequestConstants

      `DECORATOR, PAGE, ROBOT`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `OldDecorator2NewStrutsDecorator()`
    `OldDecorator2NewStrutsDecorator(com.opensymphony.module.sitemesh.Decorator oldDecorator)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected String` | `getEncoding()` 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 abstract void` | `render(com.opensymphony.sitemesh.Content content, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext, ActionContext ctx)` Applies the decorator, using the relevent contexts
    `protected void` | `render(com.opensymphony.sitemesh.Content content, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext, com.opensymphony.sitemesh.webapp.SiteMeshWebAppContext webAppContext)` Applies the decorator, creating the relevent contexts and delegating to the extended applyDecorator().

    - ### 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 Detail

    - #### oldDecorator

          protected com.opensymphony.module.sitemesh.Decorator oldDecorator

  - ### Constructor Detail

    - #### OldDecorator2NewStrutsDecorator

          public OldDecorator2NewStrutsDecorator(com.opensymphony.module.sitemesh.Decorator oldDecorator)

    - #### OldDecorator2NewStrutsDecorator

          public OldDecorator2NewStrutsDecorator()

  - ### Method Detail

    - #### render

          protected abstract void render(com.opensymphony.sitemesh.Content content,
                                         javax.servlet.http.HttpServletRequest request,
                                         javax.servlet.http.HttpServletResponse response,
                                         javax.servlet.ServletContext servletContext,
                                         ActionContext ctx)
                                  throws javax.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:
        `javax.servlet.ServletException`
        `IOException`

    - #### render

          protected void render(com.opensymphony.sitemesh.Content content,
                                javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response,
                                javax.servlet.ServletContext servletContext,
                                com.opensymphony.sitemesh.webapp.SiteMeshWebAppContext webAppContext)
                         throws IOException,
                                javax.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`
        `javax.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.

Copyright © 2000–2022 Apache Software Foundation. All rights reserved.