Class TemplateMap


  • public class TemplateMap
    extends Object
    An object to hold the incoming and outgoing templates in pairs, used with RedirectDefinable
    Author:
    Aaron Zeckoski (azeckoski @ gmail.com)
    • Constructor Detail

      • TemplateMap

        public TemplateMap​(String incomingTemplate,
                           String outgoingTemplate)
        Parameters:
        incomingTemplate - the URL template pattern to match including the /prefix using {name} to indicate variables
        Example: /{prefix}/{thing}/site/{siteId} will match the following URL:
        /myprefix/123/site/456, the variables will be {prefix => myprefix, thing => 123, siteId => 456}
        NOTE: all incoming URL templates must start with "/{prefix}" (TemplateParseUtil.TEMPLATE_PREFIX)
        outgoingTemplate - the URL template pattern to fill with values from the incoming pattern, this can start with anything, but will be processed as an external redirect if it starts with "http" or "/" (unless it starts with "/{prefix}"), otherwise it will be processed as an internal forward
    • Method Detail

      • getIncomingTemplate

        public String getIncomingTemplate()
      • setIncomingTemplate

        public void setIncomingTemplate​(String incomingTemplate)
      • getOutgoingTemplate

        public String getOutgoingTemplate()
      • setOutgoingTemplate

        public void setOutgoingTemplate​(String outgoingTemplate)