Upgrading jquery.js in primefaces.jar without modifying the JAR

浪子不回头ぞ 提交于 2019-12-23 20:17:34

问题


I am working with Primefaces 3.1 and I found a bug in the jquery.js used (the bug is described and fix here: http://forum.jquery.com/topic/datepicker-doesn-t-work-inside-fixed-div). I am wondering if there is an elegant way for replacing the .js?

The replacement directly in the jar cannot be done because we are using Maven and I don't want to customise a library.

Currently, I replaced the HeadRenderer to remove the jquery.js from the header and I added my own js file, but there's maybe a Primefaces built-in option to do the same?


回答1:


Just put the desired jquery.js file in your own webapp project with the same resource identifier as PrimeFaces is using for its bundled jQuery: primefaces:jquery/jquery.js. Webapp's own resources with the same identifier have loading precedence over those in JARs.

Thus, here:

WebContent
 |-- META-INF
 |-- WEB-INF
 |-- resources
 |    |-- primefaces
 |    |    `-- jquery
 |    |         `-- jquery.js
 :    :

Alternatively, just upgrade PrimeFaces itself. 3.1 is quite ancient anyway.



来源:https://stackoverflow.com/questions/21859987/upgrading-jquery-js-in-primefaces-jar-without-modifying-the-jar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!