Class TemplateController


  • public class TemplateController
    extends org.apache.struts.tiles.actions.TilesAction
    Controller for the template tile. This tile can be used for real template input or to preview a TemplateQuery that is in construction. The preview case involves the page controller or action putting the TemplateQuery in the request attribute "previewTemplate". The jsp can also render differently based on the presence of the "previewTemplate" attribute.

    Author:
    Mark Woodbridge, Thomas Riley, Richard Smith
    • Field Summary

      • Fields inherited from class org.apache.struts.action.Action

        servlet
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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)
      Finds the correct template to display in the following ways: First, looks for a "name" request parameter and uses that for a the lookup.
      • Methods inherited from class org.apache.struts.tiles.actions.TilesAction

        execute
      • Methods inherited from class org.apache.struts.action.Action

        addErrors, addMessages, execute, generateToken, 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
    • Constructor Detail

      • TemplateController

        public TemplateController()
    • 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
        Finds the correct template to display in the following ways:
        1. First, looks for a "name" request parameter and uses that for a the lookup.
        2. If "name" parameter doesn't exist, looks for TemplateQuery in request attribute "previewTemplate".
        In all cases where a template name is provided (in other words, the template query was not provided in the "previewTemplate" request attribute), the template is then looked up based on the value of the "scope" request parameter.
        Overrides:
        execute in class org.apache.struts.tiles.actions.TilesAction
        Throws:
        java.lang.Exception