Wicket is Wicked

In the course of investigating some alternative web frameworks (other than Struts2, which I do like) I decided to take a look at Wicket. This is a vastly different way of creating web projects, and I am really starting to like it. The big difference is that you don’t need a lot of configuration, and you do a lot of coding that looks like real Java classes. You get to add components and listeners to a class that acts as your page. There is a html file that goes with each page, but it is just html. Only the wicket:id element to the span (or other html) tags indicates that there is anything different. You link to other html pages, and wicket does the rest.

I am using Eclipse with a couple of plug ins. First is a maven plug in, m2eclipse. This plug in is really coming along nicely. We have had some hicups with a larger project that is made up of 12 separate projects, but for smaller suff, maven and this plug in just rocks. It downloads and updates the build path automatically for you. Next is the Wicket Bench plug in. I am not sure I have this working perfectly yet, I still get some issues with the wicket:id elements in my tags, but the cool thing is that it will associate your Java and corresponding html file together for you. Very nice.

I played with a couple of examples, but then decided to take the next step and get some database access going. I found a project called Databinder that will glue wicket and something like Hibernate together. I downloaded, added databinder, hibernate, and HSQLDB to my dependencies in my maven project, and poof, everything downloads ready to play.

I then set out to try the Graffiti example on the Databinder site. (Check out the screencast on the site. Very cool.) Here I did run into trouble. The Databinder project has some maven “templates” that you can use to create a project to run the examples, but that is not what I did. I just wanted to get the dependencies into maven, and enter/copy/paste the code I wanted. It was a bit of a pain, but I finally found a snapshot repository that Databinder maintains that would download the appropriate jars to get up and running. It would be nice if there was a simple explanation of the maven dependency requirements on their site.

I had issues with the servlet api, and the jta jars too. I had to add them as dependencies my self.

After that, I had to figure out how to configure the HSQLDB to play nice with hypersonic. The example came with a mysql config. I found an example elsewhere and pasted it in, but ran into an error that tracked down to hypersonic not likeing the dialect to be configured before the driver. Live and learn.

The one other thing I came across is that the example has you doing a sort that throws a runtime exception. Ditching the sort works fine. Still not sure why this is not working. Maybe I don’t have the right version of the code.

I am liking Wicket though. Hopefully I will get some more time to look into it further.