Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-16581

URIEditor should not double escape classpath: URIs

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Complete
    • 4.3.14, 5.0.4
    • 4.3.15, 5.0.5
    • Core
    • None
    • true

    Description

      My Tomcat installation has a space character in the path (installation is provided so I cannot change this). I want to configure my EhCache via JCacheManagerFactoryBean, property cacheManagerUri=classpath:ehcache.xml. The resource URL yields something like ...%20... which is the correct encoding of the space character, but then the default URIEncoder (which is "encoding" by default) encodes the percent sign and I end up with a URI like ...%2520... which does not work for obvious reasons. I do not understand why the URIEditor needs to "encode" at all, looks like fixing broken URIs at the wrong place, but at least for the case of classpath: URI's I absolutely do not see a point in applying any additional encoding. The resource gives a valid URL and this is just fine as it is.

      I suggest to replace the createURI(url) in URIEditor:110 by a simple new URI(url). Running such patch fixes the issue for me.

      Attachments

        Issue Links

          Activity

            People

              juergen.hoeller Juergen Hoeller
              blochg Gerhard Bloch
              Spring Issues Spring Issues
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                3 years, 38 weeks, 1 day ago