code: public static URLTemplatesFactory createURLTemplatesFactory( ServletContext servletContext )
      {
          // get the URLTemplatesFactory from the containerAdapter.
          ServletContainerAdapter containerAdapter = AdapterManager.getServletContainerAdapter( servletContext );
          URLTemplatesFactory factory = (URLTemplatesFactory) containerAdapter.getFactory( URLTemplatesFactory.class, null, null );
  
          // if there's no URLTemplatesFactory, use our default impl.
          if ( factory == null )
          {
              factory = new DefaultURLTemplatesFactory();
          }
  
          return factory;
      }
docs: Get an uninitialized instance of a container specific URLTemplatesFactory
  from the ServletContainerAdapter. If none exists, this returns an instance
  of {@link DefaultURLTemplatesFactory}. Caller should then set the known
  and required tokens, call the {@link URLTemplatesFactory#load(javax.servlet.ServletContext)}
  method and {@link URLTemplatesFactory#initServletContext(javax.servlet.ServletContext,
  org.apache.beehive.netui.core.urltemplates.URLTemplatesFactory)}.
  
  <p>
  IMPORTANT NOTE - Always try to get the application instance from the ServletContext
  by calling {@link URLTemplatesFactory#getURLTemplatesFactory(javax.servlet.ServletContext)}.
  Then, if a new URLTemplatesFactory must be created, call this method.
  </p>
  
  @param servletContext
  @return a container specific implementation of URLTemplatesFactory, or
  {@link DefaultURLTemplatesFactory}.