Geertjan's Blog

  • August 15, 2007

When Boudreau Met Wicket...

Geertjan Wielenga
Product Manager
The latest contributor to the NetBeans Wicket Support Project is Tim Boudreau himself. As a direct result, most of the 5.5 functionality is already available for 6.0, even though 6.0 doesn't officially exist yet. To check things out, go here and check out branch nb_60. Then open 'suite', which will give you this:

Run the suite. A new instance of the IDE starts up, installing the above two modules. Since you also have the source code of the modules, feel free to extend them with your own Wicket-related functionality. Here's what you'll find in the 6.0 version of Wicket support, thanks to Tim:

  • There is now a suite.
  • There is now a module which installs the following libraries:
    • Wicket (with extensions).
    • Wicket Security (some more extensions for using HiveMind).
    • Jasypt - Very handy simple strong encryption.
  • Refactorings are working again. Added a copy-class refactoring plugin, so if you copy a Java file with markup somewhere, the markup gets copied too.
  • Hyperlinks work again, now using the Lexer API. Just hold down the Ctrl key while moving the mouse over a Wicket ID in an HTML file. You'll see a link that you can click to open the corresponding Java document.
  • Deleted the hints, verification, etc. stuff for now. Planning to merge it back in from the trunk and get it working piece by piece.
  • Removed a bunch of duplicate code and created a small API/SPI for a few pretty straightforward things:
    • MarkupForJavaQuery - you can guess what these do - right now they just look for side-by-side html and Java files, but Wicket does let you do other layouts, so perhaps we can detect that and provide an implementation.
    • JavaForMarkupQuery
    • WicketProjectQuery - figures out if a project is using Wicket so any other functionality should be available.
  • The Pizza example now lives in templates/pizza, and is rebuilt when you build the module.

Most interestingly, Tim added a much more extensive self-made sample project, in addition to the Pizza application. You'll find it in Samples | Web, together with the Pizza application:

What it is is a basic full blown web application with:

  • User authentication - login, register and change password support
  • SSL support for pages that need it
  • Access control for pages based on whether the user is logged in or not
  • Shows use of repeaters and panels
  • ...and a bunch of other stuff

When you run it, you'll see the following in your browser:

These two samples, the Pizza application and the Login application, should set you up for working with Wicket, together with all the various project and file templates for which there is continuing support:

Hurray for Wicket users in NetBeans IDE. There's now more than enough functionality already available for 6.0 to get you up and started with Wicket! I doubt there is anything in the 5.5 Wicket tutorial that you cannot now already apply to 6.0, so go here for the tutorial. However, Tim's Login sample is the most interesting new piece in the current 6.0 story for Wicket, so have a look at that and see how everything fits together simply and coherently, which is the typical Wicket way.

Join the discussion

Comments ( 2 )
  • Jeff Wednesday, February 11, 2009

    I'm using Netbeans 6.5 and when I open the Login Application sample, it won't run. Get an error on return (T) getModel(); on BasePage and anywhere getModelObjectAsString() is called. Tip?

  • Ondra Wednesday, May 5, 2010

    Hi, is the Wicket plugin going to be supported / evolve further? The Wicket framework is gaining some momentum and is becomimg more popular, from what I can see.

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha