Wicket migration: from 1.2.6 to 1.3.0-beta4

November 12, 2007

Since 1.3.0 is knocking, we decided to upgrade what we currently have (which is a small module from the functional web app) to wicket 1.3.0. The guide to migrating or the things that are different in 1.3 vs. 1.2.6 are here .

Here is the list of things I ran into when migrating

Organize Imports

All of the packages had to be re-imported because as of 1.3.0 wicket is under Apache license and instead of wicket.* it is org.apache.wicket.* That is not a big deal if you use an IDE like Eclipse. Or any other text editor that has a powerful regexp facility or simply organize imports menu item.

1.3 uses Filter, Not Servlet

If your environment supports filters, then just replace the servlet and servlet-mapping with filter and filter-mapping

http://cwiki.apache.org/WICKET/migrate-13.html#Migrate-1.3-FilterinsteadofaServlet

Converters

If you were using custom converted in your app and you were extending SimpleConverterAdaptor, now there is a different component you have to extend: AbstractConverter.

Submit Link

If you were using SubmitLink for button functionality in 1.2.6 put SubmitLink inside a Form. Because SubmitLink doesn’t extend Button anymore, it doesn’t by default turn into a a submit. So if you have it outside than put a form around it (it is a good idea anyways – why would you have a submit without a form? What are you submitting?)

ISessionFactory is gone

Instead of creating an inner class inside Application to implement a SessionFactory just to create a custom Session there is a method called newSession (Application, Request) which you can over-ride to create one.

Wicket-Spring Jar

Was split into 2 wicket-ioc and wicket-spring to provide common functionality for integrating Guice.

Tags:

2 Responses to “Wicket migration: from 1.2.6 to 1.3.0-beta4”

  1. sp Says:

    Hey, it’s great to find someone playing with Wicket.

    Although there seems to be a problem with the newSession() method overriding since it’s declared final in WebApplication class, at least in the 1.3-RC2 version.

    I guess, the ISessionFactory still has to be used for this one. Could you please describe the way you used it in a little more detail?

  2. wicketthings Says:

    Hi, thank you for commenting. You have to override

    public Session newSession(Request request, Response response)

    this method is not final I don’t think. The final and deprecated methods are

    public final Session newSession()

    and

    public final Session newSession(Request request)


Leave a Reply