public WebappTemplateLoader(ServletContext servletContext,String subdirPath){
  if (servletContext == null) {
    throw new IllegalArgumentException("servletContext == null");
  }
  if (subdirPath == null) {
    throw new IllegalArgumentException("path == null");
  }
  subdirPath=subdirPath.replace('\\','/');
  if (!subdirPath.endsWith("/")) {
    subdirPath+="/";
  }
  if (!subdirPath.startsWith("/")) {
    subdirPath="/" + subdirPath;
  }
  this.subdirPath=subdirPath;
  this.servletContext=servletContext;
}

public WebappTemplateLoader ( ServletContext servletContext , String subdirPath ) { if ( servletContext == null ) { throw new IllegalArgumentException ( "servletContext == null" ) ; } if ( subdirPath == null ) { throw new IllegalArgumentException ( "path == null" ) ; } subdirPath = subdirPath . replace ( '\\' , '/' ) ; if ( ! subdirPath . endsWith ( "/" ) ) { subdirPath += "/" ; } if ( ! subdirPath . startsWith ( "/" ) ) { subdirPath = "/" + subdirPath ; } this . subdirPath = subdirPath ; this . servletContext = servletContext ; }
creates a template loader that will use the specified servlet context to load the resources . it will use the specified base path , which is interpreted relatively to the context root ( does not mater if you start it with " / " or not ) . path components should be separated by forward slashes independently of the separator character used by the underlying operating system .
