Wicket first contact

While working on an AJAX web application a couple of weeks ago, a co-worker asked me what I know about Wicket. Not much at that time. I knew it was some kind of component based web framework, but only in the sense like everybody knows that Porsche is a German car brand.

During the recent holidays I spent the entire time away from work and with my family. As most of the time when I’m away from work I made a list of things to look at. Wicket was not on that list. I seldom make it at least half way thru that list anyway. It was the same this time. But then I saw this article on TheServerSide about the release of Wicket 1.3. The big amount of comments caught my interest. Suddenly, Wicket was on that list.

Today, I downloaded and installed Wicket, and then looked for documentation and tutorials. Besides some interesting online resources, I found the combination of two books on Wicket the most helpful:

The first book seems a little more verbose than the second book and covers more background, while the second book (besides being more complete right now) has much more source code examples. They complement each other perfectly in my opinion. So I got them both.

After reading thru the first three freely available chapters of “Enjoying Web Development with Wicket”, I got interested in chapter 6 (Supporting Other Languages). I was really impressed to see how I18N is a first class citizen in Wicket.

Screenshot from the Cheesr sample application

I then turned to “Wicket in Action”. Right now it is not completed and contains many errors, but none of this is really a problem. I made it thru the chapters 1-4 and implemented the Cheesr sample application (from chapter 4) along the way.

I really like what I’ve seen so far from Wicket:

  • It’s component based and encapsulates the request/response cycle
  • Components seem easy to write
  • Good internationalisation concept
  • Separation from logic and presentation

Right, I’ve barely scratched the surface yet, but Wicket as a web framework looks promising.

Comments

Why I upgraded to GWT 1.4.61

The previous version GWT 1.4.60 came out on August 27th, 2007. A couple of days later I had upgraded all my applications, the expression calculator demo too. None of the applications suffered from a strange bug except the demo. It appeared only when Microsoft’s Internet Explorer was used. A message box was displayed that told the user: “operation aborted”. The page wasn’t shown at all, the user only saw a blank page. I had to remove the demo, at least from the home page. Since only the demo was affected, I didn’t go back to GWT 1.4.59.

Three days after GWT 1.4.60 came out, the issue was reported, approximately at the same time I was experiencing it. I was hoping for a quick fix, but it didn’t come.

Several month later, Google’s Scott Blum wrote in the GWT forum about an updated GWT 1.4 release. Although I read the forum quite regularly, I nearly missed his posting. He talks about the new release fixing the problem, and he also provides a download link for GWT 1.4.61. I’ve downloaded it and upgraded all my application without a problem so far.

Google Web Toolkit 1.4.61 is available for download

Since it fixes a very serious problem, you should upgrade also. Problem is, you will not see the new version on the GWT download page. At least not yet, but I bet you will see it there shortly. In the meantime, just use this link.

Update: It took a little bit longer than I expected, but the GWT Team has just officially released GWT 1.4.61, which takes care of some minor bugs in the previous release of GWT 1.4.60. The two main issues that were addressed are the “operation aborted” startup error on IE and a potential XSS vulnerability in hosted mode.

There are no differences between the 1.4.61 version released on December 12th, 2007 and the 1.4.61 version released on November 3rd, 2007.

Comments

Trac for a team of one

Even the smallest development team (one developer) needs a source code repository with versioning like Subversion to track all the changes made to the source code over time, and to reproduce the revisions software releases were based on. The ability to create branches is necessary to maintain software releases in the field, while continuing with development at the same time. If you think you don’t need it, you probably don’t know enough about it (in a couple of really rare cases, you might indeed not need it, but even then it really doesn’t hurt). For most developers, working with a source code repository is as natural as working with an IDE like Eclipse.

Even though small development teams use a version system in many cases, an issue tracking system is used to a lot lesser extend. But I believe that it’s quite as important as having something like Subversion, because it makes the developers life so much easier. I have just experienced it while working in a small team during my current project. And there are solutions out there, that are easy to install and maintain. One (and one of the easiest and best) is Trac: Trac is an integrated software configuration (and project) management system (SCM). It’s an issue tracking system for software development projects with an integrated wiki. Basically, it’s a project management suite which includes a wiki, a bug/issue tracking system, and a source control viewer that accesses a Subversion repository.

Screenshot of Trac XML-RPC plugin working with Eclipse and Mylyn

Since developers always tend to try out the newest and latest (I’m no exception to this rule, nor do I want to disappoint you), I’ve installed the Trac version currently under development (0.11dev). The integration with the Eclipse development environment also requires the latest development version of the Trac XML-RPC plugin. This is what you should have installed already:

  • Eclipse development platform with Mylyn Trac Connector.
  • Working Subversion (SVN) installation.
  • Python is installed on your system (Trac is written in Python).
  • easy_install is available.
  • It helps if you have installed an older version of Trac (e.g. 0.10.4) once. If you don’t have any experience with Trac, you should go there and read their documentation.

Now install Trac and the Trac XML-RPC plugin:

  • Checkout the latest development sources from Trac: http://svn.edgewall.org/repos/trac/trunk.
  • Install/update Trac from the trunk directory: $ python setup.py install.
  • Checkout the sources from the Trac XML-RPC plugin: http://trac-hacks.org/svn/xmlrpcplugin.
  • Install/update the Trac XML-RPC plugin as decribed here: $ easy_install trunk.
  • Edit trac.ini and add (under [components]) tracrpc.* = enabled.
  • Start (or restart) Trac, e.g. via tracd.

You can now access and create your Trac tickets from within Eclipse with the help of the Mylyn Trac Connector.

Comments

A small GWT application

I had some time today, so I built a little AJAX application for this blog. It’s an expression calculator. The world really doesn’t need another one, but it was the easiest thing that includes ANTLR for building a lexer/parser/AST and the Google Web Toolkit for building the client. Why? Because it’s fun …

If the application doesn’t load, please click here!

Before I was able to include a GWT application within a post in this WordPress powered blog, I had to create a WordPress plugin that generates the necessary meta tags. GWT applications only work, when those meta tags are present.

The actual calculation of the expression is done on the server with the help of my Java based framework. The expression is sent to the server asynchronously as a JSON data packet. The server logic evaluates the expression and sends back either the result, or an error message. If you want to see an error message, try a division by 0. The response is sent also in the JSON format back to the browser, where the GWT application takes it and displays it without refreshing the whole page.

The server side logic is built with the help of ANTLR and ANTLR Studio for Eclipse. Instead of writing a lexer and parser for evaluation of the expressions myself, I’ve used a grammar to let these tools do it for me. The following screenshot shows ANTLR Studio for Eclipse in action:

Eclipse screenshot with ANTLR Studio

If you want to know what ANTLR is, here is a quote from Terence Parr, the primary author of ANTLR. He has been working on translation tools since the late 80s:

ANTLR, ANother Tool for Language Recognition, (formerly PCCTS) is a parser and translator generator tool, akin to the venerable lex/yacc duo, that lets you construct recognizers, compilers, and source-to-source translators from grammatical descriptions containing C++ or Java actions. You can build translators for database formats, graphical data files (e.g., PostScript, AutoCAD), text processing files (e.g., HTML, SGML), etc. ANTLR is designed to handle all of your translation tasks. ANTLR is recommended by the co-inventor of LL(k) parsers and by the inventor of SLR(k) and LALR(k) parser.

Another tool makes generation of GWT clients easier. It’s the GWT Designer from Instantiations. I’m having a few problems with it, but it still helps a lot. See the following screenshot for an impression:

Eclipse screenshot with GWT Designer

If you’re interested in this example built with GWT, ANTLR, JSON, etc., and you want to look at the source code, just download it from here.

Do you remember the little problem from the Geometry for kids post earlier today? With the calculator, you can verify if the solution is correct: d = sqrt(3)*5.3.

Update: As of GWT 1.4, a new application-loading mechanism has been introduced, that doesn’t require a meta tag in the page header. It’s still supported for legacy applications. But now, the applications HTML code can directly reference the JavaScript file. I’ve changed the example above accordingly.

Comments (1)

Geometry for kids

One of our girls visits the 7th grade (13 years, secondary school) right now. In geometry, they are talking about the congruence rules for triangles and triangles in general. Yesterday’s homework included a geometrical problem: construct the space diagonal of a cube geometrically and specify its length (side length of the cube is 5.3cm).

While this might be an easy problem for grownups, it seemed not so easy for her. She drew a grid model of the cube, connected the opposite vertices, and measured off the length of the resulting diagonal. It seem logical and right for her. When I asked her about the actual angles in a cube, and how they relate to her projection, it became quite clear, that some angles in the drawing weren’t quite what they should have been.

In my opinion, kids have to learn how to ask the right questions, and how to find answers. And then they should explain it to somebody else. As a freshman I earned some extra money by giving private lessons for juniors and seniors. I quickly learned, that I was only able to explain a problem and its solution in depth, when I was able to answer all kinds of questions they were throwing at me. It didn’t have anything to do with knowledge, but with the ability to express it. And that is quite harder. So whenever you want to make sure you truly understand something, talk to someone about it for a couple of minutes, and have her or him ask you questions.

Constructing the space diagonal of a cube geometrically

Finally, she was able to find a solution to the problem. I didn’t explain it to her, but I asked her some questions. She had to explain it to me.

Comments

« Previous entries