Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can add this to any component. Header contribution of style.css relative to MyClass will automatically be taken care off and double contributions will be filtered (ignored). This is my favorite, as you don't need components that have their own markup to do this, you can do this 'inside or outside' of a component, and it is just less typing.

In Wicket 1.5, you can use the code below:

Code Block

@Override
public void renderHead(IHeaderResponse response) {
   response.renderJavaScriptReference(new PackageResourceReference(MyClass.class, "mypackage/myscript.js"));
   response.renderCSSReference(new PackageResourceReference(MyClass.class, "mypackage/mystyle.css"));
}