org.apache.struts2.sitemesh
Class OldDecorator2NewStrutsDecorator

java.lang.Object
  extended by com.opensymphony.sitemesh.webapp.decorator.BaseWebAppDecorator
      extended by 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
protected  com.opensymphony.module.sitemesh.Decorator oldDecorator
           
 
Fields inherited from interface com.opensymphony.module.sitemesh.RequestConstants
DECORATOR, PAGE, ROBOT
 
Constructor Summary
OldDecorator2NewStrutsDecorator()
           
OldDecorator2NewStrutsDecorator(com.opensymphony.module.sitemesh.Decorator oldDecorator)
           
 
Method Summary
protected  java.lang.String getEncoding()
          Gets the L18N encoding of the system.
protected  java.util.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,
                               java.io.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
java.io.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 java.io.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:
java.io.IOException
javax.servlet.ServletException

getLocale

protected java.util.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 java.lang.String getEncoding()
Gets the L18N encoding of the system. The default is UTF-8.



Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.