Re: setTextEncoding on JavascriptResourceReferences/CssResourceReferences
Hi Martin, thank you for your reply. Followed your advise, and filled a ticket: https://issues.apache.org/jira/browse/WICKET-4457 Cheers, David -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/setTextEncoding-on-JavascriptResourceReferences-CssResourceReferences-tp4472204p4475232.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
setTextEncoding on JavascriptResourceReferences/CssResourceReferences
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
Re: Migrating to wicket 1.5
Just a quick hint about the code-snipet above. You don't really need to replace the protocol. Change it to this and the browser will automatically use the protocol, that is used by the site embedding the javascript. String jqueryURl = //ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js; component.add(JavascriptPackageResource.getHeaderContribution(jqueryURl)); :-) -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Wicket-jQuery-Validator-integration-tp4390885p4434452.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
Cache TextTemplateResourceReferences
Hi, i've been following this post in order to generate dynamic JS/CSS files ( https://cwiki.apache.org/WICKET/dynamically-generate-a-css-stylesheet.html https://cwiki.apache.org/WICKET/dynamically-generate-a-css-stylesheet.html ). Now I'm expiring white page flickers on page changes inside the browser, due to the fact that TextTemplateResourceReferences are not versioned (filename-ver-timestamp.ext) or sent with Cache-Headers (per default they are delivered with Cache: no-cache). As soon as we have uncached CSS or JS files FF/IE/Chrome/Safari seem to reload the whole page instead of applying the cached files and this leads to these annoying page flickers. So i'm searching for a solution to be able to cache TextTemplateResourceReferences by enabling the version and setting the cache headers, but I haven't found a solution yet. I'm using Wicket 1.5.3. From a friend of mine I got the tip to check IStaticCacheableResources and subclass TextTemplateResourceReference in order to return IStaticCacheableResources, but I didn't have the time yet to test it out. http://www.jarvana.com/jarvana/view/org/apache/wicket/wicket-core/1.5.0/wicket-core-1.5.0-javadoc.jar!/org/apache/wicket/request/resource/caching/IStaticCacheableResource.html http://www.jarvana.com/jarvana/view/org/apache/wicket/wicket-core/1.5.0/wicket-core-1.5.0-javadoc.jar!/org/apache/wicket/request/resource/caching/IStaticCacheableResource.html Any help on this would be really great, as I'm quite new to wicket and haven't found a good tutorial yet which explains how caching for resources is properly applied. -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Cache-TextTemplateResourceReferences-tp4432342p4432342.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