Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.5.4, 6.0.0-beta1
-
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