Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-4457

setTextEncoding on JavascriptResourceReferences/CssResourceReferences

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5.4, 6.0.0-beta1
    • 1.5.7, 6.0.0-beta1
    • wicket
    • None

    Description

      Setting the encoding of JavascriptResources and CssResources in wicket is by now not easily to achieve.
      By now only html files are equipped with the charset option afterwads, but not CSS or JS files.

      Content-Type: application/javascript;charset=UTF8

      org.apache.wicket.request.resource.AbstractResource#setResponseHeaders() does take the textEncoding into account,
      but there is no way to set it from the outside without introducing new classes by copy/pasting existing Resources and adapt them.

      The only resource which is able to modify the content-type through the constructor is the TextTemplateResource.
      One can specify "application/javascript; charset=UTF8" and pass it as the content-type parameter.
      It's a hack, but this string then used for the content-type header.
      A separate charset parameter would be better in my opinion.

      UserGroup post: http://apache-wicket.1842946.n4.nabble.com/setTextEncoding-on-JavascriptResourceReferences-CssResourceReferences-td4472204.html

      Attachments

        Activity

          People

            pete Peter Ertl
            exaptis David Loidolt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: