Download NetBeans!

20050705 Tuesday July 05, 2005

Wicket Samples as NetBeans Projects

I've converted the Wicket Examples into NetBeans IDE projects. This means that you don't need to build the samples from scratch -- you can just download the ZIP file and open the samples as projects in NetBeans IDE 4.1. Once everything's set up and running smoothly, you can look at the source and learn how everything works.

Do the following to get going with Wicket in NetBeans IDE 4.1:

  1. Download the resources.

  2. Set up the samples.

    1. Open the samples. Start the NetBeans IDE and press Ctrl-Shift-O. The Open Project dialog box appears. Browse to where you unzipped the samples and select them all:

      Click Open Project Folder. The IDE opens all the projects. This dialog box appears, telling you that there are unresolved dependencies:

    2. Resolve the unresolved dependencies. Click Close in the dialog box above. Right-click "Upload", which is the last project in the list (or select any other project, other than DisplayTag), and choose Resolve Reference Problems. The following dialog box appears:

      Click Resolve. The Library Manager opens. Click New Library and create a library called "wicket", containing all the JARs found in the downloaded Wicket API's lib folder. (Optionally, if you don't want to use the servlet-2.3.jar, you can use the servletapi24.jar that is included in the NetBeans installation directory's enterprise1/modules/autoload folder.) Click OK and the IDE adds the wicket library to all the projects.

      But there are other unresolved references. Right-click "Upload" again, choose Resolve Reference Problems, click Resolve and select the "BasisForOtherSamples" project. This contains Java classes that are shared by the other samples. Repeat this process for all the other projects. (Since several samples share this project, you can modify these Java classes in one place -- in the separate project in which they are found.)

      Notice that DisplayTag has a few additional unresolved references. This is because DisplayTag is a pretty extensive sample, which requires several additional APIs. They are as follows (clicking on the following links brings you to where you can download the APIs) Commons Lang API, Commons Collections API, Wicket Extensions API.

  3. Run the samples. Once all the references have been resolved (or, at least, all the references for the samples in which you're interested -- you may want to leave DisplayTag for last), right-click a project and choose Run Project:

    Tomcat, which is bundled with NetBeans IDE, starts up automatically and your project is deployed. (Note that there are currently two projects that have problems with images, so that their images are not displayed correctly -- "Pub" and "Nested". I'll fix those soon.)

    Once the project is deployed succesfully (compare each deployed sample to their official Wicket version here if you're not sure), go back to the IDE and explore the sources, aided by the Wicket API Javadoc. (You can also join a Wicket Mailing List.)

Jul 05 2005, 05:34:29 AM PDT Permalink