0

trying to get wicket app to use packaged jquery v 3.2.1. I see this along with v 1.x and 2.x files in wicket-core-7.10.0.jar\org\apache\wicket\resource\jquery.

i tried below in my app init but this is not finding the resource ResourceReference rnew = new UrlResourceReference(Url.parse("jquery/jquery-3.2.1.js")).setContextRelative(true);

I see there is a class called JQueryResourceReference but the constructor takes no params and only defaults to jquery 1.12.4. there is a class called DynamicJQueryResourceReference which seems to default to 1.12.4 or 2.2.4 based on browser version

trying to see if there is a obvious way to override Wicket 7 use of Jquery to 3 overall or i need to supply my own version as a seperate resource and refer to it using UrlResourceReference...

1 Answers1

1

In a Wicket 8.6.1 project with Spring-boot & webjars I just overrode WicketApplication#init() like this:

@Override
protected void init()
{
    super.init();

    final WebjarsJavaScriptResourceReference ref =
            new WebjarsJavaScriptResourceReference( "jquery/3.4.1/jquery.min.js" );
    getJavaScriptLibrarySettings().setJQueryReference( ref );
}
Tobias Gierke
  • 392
  • 1
  • 9