0 Replies Latest reply on Oct 5, 2006 7:29 AM by adrian.brock

    JBossEntityResolver and predefined locations

      The JBossEntityResolver only looks in the classpath for predetermined filenames.

      I've added some code that treats the file as a system id, i.e. a URI
      when it is not found in the classpath.

       InputStream ins = loadClasspathResource(filename, trace);
       if( ins != null )
       {
       inputSource = new InputSource(ins);
       inputSource.setPublicId(publicId);
       }
       else
       {
      - log.warn("Cannot load publicId from resource: " + filename);
      + log.trace("Cannot load publicId from classpath resource: " + filename);
      
      + // Try the file name as a URI
      + inputSource = resolveSystemIDasURL(filename, trace);
      
      + if (inputSource == null)
      + log.warn("Cannot load publicId from resource: " + filename);
       }
      


      This is useful for testing where I can easily determine the URL
      using classloader.getResource() but it more difficult to determine the
      classpath location.