Wicket migration code sprint

Andrea Aime edited this page Jan 18, 2016 · 28 revisions
Clone this wiki locally


Getting started: https://dzone.com/refcardz/getting-started-apache-wicket Wicket official docs: https://ci.apache.org/projects/wicket/guide/7.x/guide/single.html

Migration references:

Old branch migrating a 2013 GeoServer towards 6.0 and full diff against its baseline

Justin's previous page Wicket-UI-TODOs on this subject.

Who's working on what https://docs.google.com/spreadsheets/d/1yzE9W4ZaIUcmE1XRcHCTih2mLEhMhVoZxKQl_k1n7D8/edit?ts=569d2137#gid=0

Semi-automatable Mass changes

  • ResourceReference -> PackageResourceReference
  • ParamResourceModel -> StringResourceModel (the Wicket 7 class is fluent enough that we don't need ParamResourceModel anymore)
  • PageParameters -> has been moved in a different pakage, the way to fill it is different
  • AjaxRequestTarget.addComponent --> AjaxRequestTarget.add
  • SimpleAttributeModifier --> AttributeModifier.replace


Java 8

Some ideas for making use of Java 8 features when updating wicket code.

Lambda Expressions

Lambda expressions can be automagically for interfaces that have one "abstract" method (ie @FunctionalInterface). This replaces the use of anonymous classes in many wicket examples.

Use of lambda to replace IVisitor:

visitChildren((Component c, final IVisit<Void> visit) -> {