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

TemplateServlet works directly with System.getProperty instead of init parameters

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.0
    • 1.6.8, 1.7.1, 1.8-beta-1
    • None
    • None

    Description

      In method: groovy.servlet.TemplateServlet#getTemplate templates are loaded using encoding defined in system properties. Hence often you are not able to access server properties due to some security or deployment issues. Why there is not alternative option to set this encoding by servlet init parameter?

      Attachments

        Activity

          roshandawrani Roshan Dawrani added a comment -

          I wanted to go ahead and introduce the change requested - introduce an init parameter for "groovy.source.encoding"

          If specified, groovy.source.encoding servlet init parameter will take preference, else it will fall back on the system property as it currently uses it.

          Anyone sees any issues?

          roshandawrani Roshan Dawrani added a comment - I wanted to go ahead and introduce the change requested - introduce an init parameter for "groovy.source.encoding" If specified, groovy.source.encoding servlet init parameter will take preference, else it will fall back on the system property as it currently uses it. Anyone sees any issues?

          I had that issue on my radar, to look into it, happy you're having a look at it too
          We have to look into whether such a change should be in the base abstract servlet, or just in the template servlet?

          guillaume Guillaume Sauthier added a comment - I had that issue on my radar, to look into it, happy you're having a look at it too We have to look into whether such a change should be in the base abstract servlet, or just in the template servlet?
          roshandawrani Roshan Dawrani added a comment -

          Happy to let you have a cleaner radar, Guillaume.

          I have introduced the init parameter encoding to be used for template source files only in TemplateServlet and not in AbstractHttpServlet, as I didn't see any use of input encoding either in AbstractHttpServlet or GroovyServlet.

          roshandawrani Roshan Dawrani added a comment - Happy to let you have a cleaner radar, Guillaume. I have introduced the init parameter encoding to be used for template source files only in TemplateServlet and not in AbstractHttpServlet, as I didn't see any use of input encoding either in AbstractHttpServlet or GroovyServlet.

          Okie dokie, thank you.

          guillaume Guillaume Sauthier added a comment - Okie dokie, thank you.
          novoj Jan Novotný added a comment -

          Thank you both for the quick response. Happy to see it in the next version.

          novoj Jan Novotný added a comment - Thank you both for the quick response. Happy to see it in the next version.

          People

            roshandawrani Roshan Dawrani
            novoj Jan Novotný
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: