atg.repository.seo
Class JumpServlet

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.nucleus.TimedOperationService
              extended by atg.servlet.pipeline.PipelineableServletImpl
                  extended by atg.servlet.pipeline.InsertableServletImpl
                      extended by atg.repository.seo.JumpServlet
All Implemented Interfaces:
atg.naming.AbsoluteNameable, NameContextBindingListener, NameContextElement, atg.naming.NameContextParentable, NameResolver, AdminableService, atg.nucleus.Configured, ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, VariableArgumentApplicationLogging, ComponentNameResolver, Service, ServiceListener, InsertableServlet, PipelineableServlet, java.util.EventListener, javax.servlet.Servlet

public class JumpServlet
extends InsertableServletImpl

The JumpServlet class supports search engine optimization (SEO).

The ItemLink droplet in the same package as this generates dynamic URLs for normal users and static URLs for search spiders. The purpose of the JumpServlet is to handle HTTP requests which have these static URLs as their request URI, since these do not correspond to actual page content.

This servlet class will perform the following steps:

  1. It will match the static URL against a predefined set of URL patterns and formats.
  2. It will then extract parameters that have been embedded as path elements in the static URL.
  3. The extracted parameter are then inserted as query parameters of a destination URL.
  4. It then forwards or redirects the request onto the destination URL.
  5. In the case of search spiders, a forward will always be used since it is undesirable for them to work with dynamic URLs. Redirects usually take place for normal visitors that have clicked on a static URL in a search results page.


    Field Summary
    static java.lang.String CLASS_VERSION
              Class version string
     
    Fields inherited from class atg.nucleus.GenericService
    SERVICE_INFO_KEY
     
    Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
    DEFAULT_LOG_TRACE_STATUS
     
    Fields inherited from interface atg.nucleus.logging.ApplicationLogging
    DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
     
    Constructor Summary
    JumpServlet()
               
     
    Method Summary
     void doStartService()
              Initialises the jump servlet.
     Repository getDefaultRepository()
               
     WebApp getDefaultWebApp()
               
     IndirectUrlTemplate[] getTemplates()
               
     boolean isPrependContextPathForRedirect()
              Returns property prependContextPathForRedirect
     void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
              Main service method of this servlet.
     void setDefaultRepository(Repository pDefaultRepository)
               
     void setDefaultWebApp(WebApp pDefaultWebApp)
               
     void setPrependContextPathForRedirect(boolean pPrependContextPathForRedirect)
              Sets the prependContextPathForRedirect property
     void setTemplates(IndirectUrlTemplate[] pTemplates)
               
     
    Methods inherited from class atg.servlet.pipeline.InsertableServletImpl
    getInsertAfterServlet, setInsertAfterServlet
     
    Methods inherited from class atg.servlet.pipeline.PipelineableServletImpl
    createAdminServlet, destroy, getAdminServlet, getNextServlet, getServletConfig, getServletInfo, init, isUsePathInfo, passRequest, passRequest, service, service, setNextServlet, setServletInfo, setUsePathInfo
     
    Methods inherited from class atg.nucleus.TimedOperationService
    getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics
     
    Methods inherited from class atg.nucleus.GenericService
    addLogListener, doStopService, getAbsoluteName, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, reResolveThis, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
     
    Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
    vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     
    Methods inherited from interface atg.servlet.pipeline.PipelineableServlet
    getNextServlet, passRequest, setNextServlet
     
    Methods inherited from interface javax.servlet.Servlet
    destroy, getServletConfig, getServletInfo, init, service
     

    Field Detail

    CLASS_VERSION

    public static java.lang.String CLASS_VERSION
    Class version string

    Constructor Detail

    JumpServlet

    public JumpServlet()
    Method Detail

    getTemplates

    public IndirectUrlTemplate[] getTemplates()
    Returns:
    An array of IndirectUrlTemplate instances.

    setTemplates

    public void setTemplates(IndirectUrlTemplate[] pTemplates)
    Parameters:
    pTemplates - The array of IndirectUrlTemplate instances to set.

    getDefaultRepository

    public Repository getDefaultRepository()
    Returns:
    The default repository.

    setDefaultRepository

    public void setDefaultRepository(Repository pDefaultRepository)
    Parameters:
    pDefaultRepository - The default repository to set.

    getDefaultWebApp

    public WebApp getDefaultWebApp()
    Returns:
    The default WebApp that is configured for this jump servlet instance.

    setDefaultWebApp

    public void setDefaultWebApp(WebApp pDefaultWebApp)
    Parameters:
    pDefaultWebApp - The default WebApp to set.

    isPrependContextPathForRedirect

    public boolean isPrependContextPathForRedirect()
    Returns property prependContextPathForRedirect

    Returns:
    prependContextPathForRedirect property

    setPrependContextPathForRedirect

    public void setPrependContextPathForRedirect(boolean pPrependContextPathForRedirect)
    Sets the prependContextPathForRedirect property

    Parameters:
    pPrependContextPathForRedirect - The property value to set

    doStartService

    public void doStartService()
                        throws ServiceException
    Initialises the jump servlet.

    Overrides:
    doStartService in class InsertableServletImpl
    Throws:
    ServiceException
    See Also:
    GenericService.doStartService()

    service

    public void service(DynamoHttpServletRequest pRequest,
                        DynamoHttpServletResponse pResponse)
                 throws javax.servlet.ServletException,
                        java.io.IOException
    Main service method of this servlet.

    This will match the request URI against a known IndirectUrlTemplate using its templates property

    When a match is made, it extracts the parameters from the URL and generates a destination URL using these parameters as query parameters. It then either forwards or redirects the visitor to the destination URL.

    Overrides:
    service in class PipelineableServletImpl
    Parameters:
    pRequest - The HTTP request
    pResponse - The HTTP response
    Throws:
    javax.servlet.ServletException - Indicates an error
    java.io.IOException - Indicates an error