Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-5935

GroovyServlet script resolving broken

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.8.8, 2.0.5, 2.3.0
    • Fix Version/s: None
    • Component/s: Groovlet / GSP
    • Labels:
      None

      Description

      When using groovy script with the GroovyServlet, script resolving is currently broken. It works the first time, but as soon as the entry is cached, resolving no longer works. groovy.servlet.AbstractHttpServlet tries to resolve the script file in order to determine the last modification time, but fails to do this with file: URLs.

      This commit breaks the resource loading in groovy.servlet.AbstractHttpServlet:
      https://github.com/groovy/groovy-core/commit/e941c940655bbdf0b62c60ff02754e993394b3a8#src/main/groovy/util/GroovyScriptEngine.java

      The commit above changed the path being used for resource loading to a full URL with a file: scheme, which is not taken into account when loading resources in groovy.servlet.AbstractHttpServlet.getResourceConnection(String)

      An easy fix would be to change groovy.servlet.AbstractHttpServlet to parse the provided name as URI and get the path from it.

        Attachments

        1. GroovyNotFound.war
          6.79 MB
          Guy Rouillier
        2. abc.groovy
          0.1 kB
          Wolfgang Schell
        3. Bug5935Main.groovy
          0.8 kB
          Wolfgang Schell

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jetztgradnet Wolfgang Schell
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated: