Wicket in Action

A comprehensive guide for Java developers building Wicket-based web applications

Removing Fragile String Expressions From Wicket Code

November 25th, 2009 by ivaynberg

The most used model in Wicket is the PropertyModel and its derivatives. This model allows the user to quickly and easily navigate object graphs using string-based property-path expressions, and is used extensively when displaying data or creating forms.

However, the PropertyModel and its string-based expressions are also responsible for adding the most fragility to Wicket code. The standard Java tooling does not support refactoring strings that happen to contain references to java constructs such as methods or fields; thus errors in these string expressions are not discovered until runtime.

For example, the string used in the code below:

new Label("state",
        new PropertyModel(personModel, "address.state.code"));

will not be updated by the tooling when the getState() method is renamed into getArea() and will thus cause an error only discoverable at runtime.

So why is PropertyModel used so often in Wicket code even though it causes so many problems? The answer is simple: it is, by far, the easiest and most convenient way to achieve the functionality. We chose to sacrifice robustness of our code for development ease and convenience. What if there was another way to achieve the same, but without using strings?
Read the rest of this entry »

London Wicket Event November 21st

November 4th, 2009 by dashorst

Something special is brewing in downtown London on Saturday, 21st November. jWeekend is organizing a very special event at the iconic Foyles Bookshop in central London.

Join core committers Matej, Alastair, Jeremy and Martijn together with WiQuery gurus Richard and Lionel for an afternoon of intellectual Wicketness.

Join us for some very interesting, high quality presentations and to chat with fellow Wicket users and developers at all levels. We’re expecting this to be another popular event and since places are limited book and confirm early if you can make it. Details and registration are at the usual place.

There is a cool little Jazz cafe at Foyles too, where there’ll be a live act (Femi Temowo) at 13:00 if you enjoy some Jazz guitar relaxation before your intellectual stimulation. They offer a decent range of food and drink there too.

I’ll be available to sign some books, so Bring Your Copy of Wicket in Action—or buy one in the store and have it signed!

Timo Rantalaiho talks about Apache

September 28th, 2009 by dashorst

Fellow Apache Wicket committer and TDD enthousiast Timo Rantalaiho discusses how he came to Apache in this Apache 10th anniversary video:

Take a look at his shirt :)

Wicket takes lead in test over Grails, JSF/Seam and Tapestry

September 14th, 2009 by dashorst

Peter Thomas, renowned for his previous comparisons between web frameworks has put all the popular choices of the moment next to one another in one short article. I haven’t tried the benchmark myself, but I like the results:

Overall, Wicket is fastest, with Tapestry coming a close second.

Read it yourself, and then confirm the results yourself.

Wicket 1.4.1 supports Ajax file uploads

August 20th, 2009 by dashorst

The Apache Wicket project is proud to announce the first maintenance release: Apache Wicket 1.4.1. The most notable change in this release is the transparent support for multipart form submissions via Ajax. Wicket is now smart enough to submit a form using a hidden iframe rather then the standard XMLHttpRequest if the form contains file upload fields.

You can download the release here:
http://www.apache.org/dyn/closer.cgi/wicket/1.4.1

Or use this in your Maven pom’s to upgrade to the new version:

<dependency>
    <groupId>org.apache.wicket</groupId>
    <artifactId>wicket</artifactId>
    <version>1.4.1</version>
</dependency>

A complete list of changes can be found in our Jira instance.

We thank you for your patience and support.

The Wicket Team

Apache Wicket 1.4 takes type safety to the next level

July 30th, 2009 by dashorst

The Apache Wicket project is proud to announce the release of Apache Wicket 1.4. Apache Wicket is an open source, component oriented Java web application framework. With overwhelming support from the user community, this release marks a departure from the past where we leave Java 1.4 behind and we require Java 5 as the minimum JDK version. By moving to Java 5 as the required minimum platform, we were able to utilize Java 5 idioms and increase the type safety of our APIs. Using Java generics you can now write typesafe web applications and create typesafe, self documenting, reusable custom components.

Download Apache Wicket 1.4

You can download the release here: http://www.apache.org/dyn/closer.cgi/wicket/1.4.0

Or use this in your Maven pom’s to upgrade to the new version:

<dependency>
  <groupid>org.apache.wicket</groupid>
  <artifactid>wicket</artifactid>
  <version>1.4.0</version>
</dependency>

You will need to upgrade all modules (i.e. wicket, wicket-extensions) to their 1.4 counterparts. It is not possible to mix Wicket 1.3 libraries with 1.4 libraries due to API changes.

Most notable changes

From all the changes that went into this release, the following are the most important ones:

  • Generified IModel interface and implementations increases type safety in your Wicket applications
  • Component#getModel() and Component#setModel() have been renamed to getDefaultModel() and setDefaultModel() to better support generified models
  • The Spring modules have been merged (wicket-spring-annot is now obsolete, all you need is wicket-spring)
  • Many API’s have been altered to better work with Java 5’s idioms
  • Wicket jars are now packaged with metadata that makes them OSGI bundles

Apart from these changes, the release is mostly compatible with Wicket 1.3 and upgrading shouldn’t take too long. Early adopters report about a days work to upgrade medium to large applications to Wicket 1.4. Read the migration guide to learn more about the changes in our APIs. To learn more about all the improvements and new features that went into this release, check the solved issue list in our JIRA instance.
Read the rest of this entry »

Apache Wicket 1.3.7 marks end of life for Wicket 1.3

July 30th, 2009 by dashorst

The Apache Wicket team is proud to present the release of Apache Wicket 1.3.7. This will be the last feature release for the 1.3.x branch. Going forward, only security fixes will be released in the 1.3.x branch – meaning that 1.3.7 may be the last release in this branch. All users are encouraged to upgrade to 1.4.0 as soon as possible. As work begins on 1.5 in the near future, we will be supporting 1.4.x and 1.5.x.

Eager people click here to download the distribution, others can read the release notes. We thank you for your patience and support.

The Wicket Team

Wicket Training at ApacheCon US 2009

July 7th, 2009 by jrthomerson

I am very happy to announce that there will be a one day training course at the 2009 ApacheCon conference in Oakland, CA (USA).   Before I tell you more about it, consider the following “top ten” list:

Top Ten Reasons You Should Attend ApacheCon US 2009:
10: Hacking is encouraged at the Apache Hackathon two day event.
9: Free beer! http://wiki.apache.org/apachecon/ApacheConUS2009Program
8: Meet members of your favorite projects (i.e. me last year getting Martijn to sign my copy of Wicket in Action: see Martijn signing my book)
7: Free two day BarCamp
6: Free meetups three nights of the week
5: It’s always a good time to visit California: http://oaklandcvb.com/
4: Support the tenth anniversary of the Apache Software Foundation and the many other great projects that will be there.
3: Did I mention FREE BEER?
2: Two attendees in the class will receive FREE copies of Wicket in Action
1: WICKET TRAINING! (more info)

More details will be coming soon, but if you are looking to get your feet wet with Wicket, you should certainly start making plans now to attend the 2009 US ApacheCon, and the Wicket training class that will be held.  Those who register early get discounts, too!

The class will consist of fast-moving explanations of core design principles, Wicket components, and “The Wicket Way”, and each section will be followed by a coding practice where you can put into use what you just learned.  We will focus on laying a foundation – how to use Wicket, create pages, organize your application, and create a Wicket application.

We will cover the following:
- The fundamentals of Wicket
- Handling data / working with objects and models
- Standard components provided by framework
- Containers / Application / Session / Page
- Effective code reuse strategies

ApacheCon site: http://www.us.apachecon.com

November 2-6, 2009 in Oakland, CA.  Classes will be held on Monday and Tuesday.  Wednesday through Friday will be for the conference sessions.  The Wicket class will be held on Tuesday.

Follow ApacheCon on Twitter: http://twitter.com/apachecon

Wicket in Action review by jduchess

June 23rd, 2009 by dashorst

The Dutch female Java developer community website jduchess has written up a review of Wicket in Action. They provide a nice summary per chapter detailing the contents of each, and conclude:

Wicket in Action is the perfect book if you want to get started with Wicket. [...] It’s also a good book if you’ve already been playing with the framework for a little while and want to really understand what it is you’re working with.

Many thanks go to Linda van der Pal for writing this detailed review!

Get Wicket in Action at 50%

June 17th, 2009 by dashorst

Manning is celebrating 500 twitter followers with a 50% discount until June 18th: use the coupon code twtr0618 when going through checkout at the Manning online store. This means Wicket in Action for half the price, quite a bargain!

With this book, Wicket will become the greatest territory the Dutch have settled since Manhattan.

Nathan Hamblen
Senior Software Engineer, Teachscape Inc.

This is the complete and authoritative guide to Wicket, written and reviewed by the core members of the Apache Wicket team. If there's anything you want to know about Wicket, you are sure to find it in this book.

Jonathan Locke
Founder and Architect of Apache Wicket, Foreword Wicket in Action

Without question, Wicket in Action... is the be-all and end-all when it comes to Wicket.

Geertjan Wielenga, Wicket Netbeans Plugin Author

The tutorial and conversational tone of the writing makes the book very approachable.

Nick Heudecker
System Mobile

Loved the sample application—it tied everything together.

Phil Hanna
Senior Software Developer, SAS Institute

The essential guide for learning and using Wicket.

Erik van Oosten
Lead programmer and Project Manager, JTeam

Finally, the Web Framework of web frameworks, Apache Wicket, now has a bible of its own.

Per Ejeklint
Senior Software Architect, Heimore group

Wicket is an innovative evolution of the MVC programming with simple roots, but without a primer such as this, it can be more challenging than it needs to be.

Brian Topping
Founder, Bill2 Inc.

Wicket In Action glues the areas of web development with Apache Wicket together and gives a great overview of Apache Wicket...it will make a great compendium.

Nino Martinez Wael
Java Specialist, Jayway Denmark