com.softslate.commerce.customer.core
Class LayoutAction

java.lang.Object
  extended byorg.apache.struts.action.Action
      extended byorg.apache.struts.tiles.actions.TilesAction
          extended bycom.softslate.commerce.customer.core.LayoutAction

public class LayoutAction
extends org.apache.struts.tiles.actions.TilesAction

The Tiles contoller action that is used by the default "baseLayout", "baseLeftLayout", and "baseCenterLayout" Tiles definitions. This controller handles various aspects of the request that correspond to the specific page the request is ending up on such as the welcome page, product page, category page, etc.

Author:
dtobey

Field Summary
(package private) static org.apache.commons.logging.Log log
           
static java.lang.String systemLayoutDirectory
          The name of the directory under the "WEB-INF/layouts" directory in the application distribution where the system's default jsp templates reside.
 
Fields inherited from class org.apache.struts.action.Action
defaultLocale, servlet
 
Constructor Summary
LayoutAction()
           
 
Method Summary
 org.apache.struts.action.ActionForward execute(org.apache.struts.tiles.ComponentContext context, org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Runs as a request is forwarded to a Tiles definition.
 java.lang.String getMessage(java.lang.String key, java.util.Locale locale)
          Look up and return a message from a given bundle among the Struts MessageResources objects in the application scope.
 
Methods inherited from class org.apache.struts.tiles.actions.TilesAction
execute
 
Methods inherited from class org.apache.struts.action.Action
addErrors, addMessages, execute, generateToken, getDataSource, getDataSource, getErrors, getLocale, getMessages, getResources, getResources, getServlet, isCancelled, isTokenValid, isTokenValid, resetToken, saveErrors, saveErrors, saveMessages, saveMessages, saveToken, setLocale, setServlet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

static org.apache.commons.logging.Log log

systemLayoutDirectory

public static final java.lang.String systemLayoutDirectory
The name of the directory under the "WEB-INF/layouts" directory in the application distribution where the system's default jsp templates reside.

See Also:
Constant Field Values
Constructor Detail

LayoutAction

public LayoutAction()
Method Detail

execute

public org.apache.struts.action.ActionForward execute(org.apache.struts.tiles.ComponentContext context,
                                                      org.apache.struts.action.ActionMapping mapping,
                                                      org.apache.struts.action.ActionForm form,
                                                      javax.servlet.http.HttpServletRequest request,
                                                      javax.servlet.http.HttpServletResponse response)
                                               throws java.lang.Exception
Runs as a request is forwarded to a Tiles definition. In particular, this method does the following:
  1. Sets the page title for the request. This is the string used in the <title> tag of the HTML's <head> section.
  2. If the current session's "layout" parameter is different than the systemLayoutDirectory, loops through each of the attributes in the Tiles context to check for the existance of overriding jsp templates. If a template corresponding to one of the context's attributes exists in a directory named after the layout, the attribute is changed to point to that template. Otherwise, the template in the systemLayoutDirectory is used.

Throws:
java.lang.Exception

getMessage

public java.lang.String getMessage(java.lang.String key,
                                   java.util.Locale locale)
Look up and return a message from a given bundle among the Struts MessageResources objects in the application scope.

Parameters:
key - Message key to be looked up and returned.
locale - The locale to look the message up with.
Returns:
The message, or null if the message can't be found.


Copyright © SoftSlate, Inc. 2003–2005