Hi,

i'm currently dealing with an encoding issue in wicket 1.5.4. When accessing
js or css files the content-type header information only includes the
content-type but not the encoding, but all our html files are send with the
correct content-type header information. 
curl has the following output:

*curl -I -k
https://localhost/wicket/resource/com.sample.wicket.resources.js.ResourcesJsScope/sample.js
*HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Last-Modified: Wed, 14 Mar 2012 09:14:39 GMT
Date: Wed, 14 Mar 2012 14:46:55 GMT
Expires: Thu, 14 Mar 2013 14:46:55 GMT
Cache-Control: public
Cache-Control: max-age=31536000
Pragma: cache
Content-Disposition: inline
Content-Type: application/javascript
Content-Length: 1285

As some of our js and css files are included from different sources we can't
influence the sites encoding and therefore it's necessary to deliver these
files with the proper charset in the content-type.

Content-Type: *application/javascript;charset=UTF8*

Now i was searching for a solution to solve this problem in wicket. I found
out that the AbstractResource.ResourceResponse class has a class member
textEncoding which is used for rendering the header response, but i didn't
find a way to set it by using the provided Javascript/Css Resources (as they
are automatically generated by their *ResourceReference classes). This link
seemed to be good, but doesn't provide a global solution as i'm looking for
a global setting to set utf-8 for all css/js resources at once. 

http://blog.sonxurxo.com/2011/04/06/setting-character-encoding-for-json-in-apache-wicket/

The second link I found (and my current solution) is to implement it via a
spring filter. It seems to work and i'm okay with this solution - but I
really would like to know how to archive the same effect in wicket?

http://forum.springsource.org/showthread.php?14063-How-to-set-setCharacterEncoding-on-Request


Cheers,
David






--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/setTextEncoding-on-JavascriptResourceReferences-CssResourceReferences-tp4472204p4472204.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to