Uploaded image for project: 'Velocity'
  1. Velocity
  2. VELOCITY-259

Can't see a reason why Velocity.mergeTemplate(String,Context,Writer) is deprecated

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.3.1
    • 1.5
    • Documentation
    • None
    • Operating System: other
      Platform: Other
    • 28377

    Description

      The encoding of template files is well-defined, so I see no reason to deprecate
      the method from above.
      There is a velocity property input.encoding which defines the encoding
      of templates
      "Character encoding for input (templates). Using this, you can use alternative
      encoding for your templates, such as UTF-8."

      I feel that Velocity.mergeTemplate(String,Context,Writer) should simply use
      that encoding.
      By deprecating the method and referencing to mergeTemplate
      (String,String,Context,Writer) you force a developer to duplicate the property.

      Suggestion:
      IF you decide to keep it deprecated, please extend the javadoc of the long
      mergeTemplate method eg:
      "
      The default encoding that Velocity uses to read template files is defined in
      the property input.encoding and defaults to ISO-8859-1.
      You can get the encoding that is currently configured in the Velocity runtime
      using
      "RuntimeSingleton.getString
      (RuntimeConstants.INPUT_ENCODING,RuntimeConstants.ENCODING_DEFAULT)"
      And you can paste that code for the second parameter of mergeTemplate.
      "

      Attachments

        Activity

          People

            Unassigned Unassigned
            g.hueller@gmx.at Gernot Hüller
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: