code: public static URLTemplatesFactory getURLTemplatesFactory( ServletContext servletContext )
      {
          assert servletContext != null : "The ServletContext cannot be null.";
  
          if ( servletContext == null )
          {
              throw new IllegalArgumentException( "The ServletContext cannot be null." );
          }
  
          return ( URLTemplatesFactory ) servletContext.getAttribute( URL_TEMPLATE_FACTORY_ATTR );
      }
docs: Gets the URLTemplatesFactory instance from a ServletContext attribute.
  
  @param servletContext the current ServletContext.
  @return the URLTemplatesFactory instance from the ServletContext.