Wicket Tutorial

Apache Wicket is a simple and features rich component-based web framework, the real reusable components is the main selling point of this framework. However, due to the big different between component-based and MVC architecture, it makes Wicket hard to learn, especially for those classic MVC developers.
In this tutorials, it providing many step by step examples and explanations on using Apache Wicket 1.4.
Basic & Configuration
Wicket hello world, basic stuff and URL configuration.
- Wicket Hello World Example
A simple hello world to explore the basic structure of Wicket web application. - Setup Wicket examples in local enviroment
Setup a cloned Wicket example site in your local development environment for quick reference. - PageParameters example
Learn how to pass parameters to another page. - Make Wicket URL bookmarkablePage Structure friendly
By default, Wicket generated URL is ugly, here is a way to make the URL more neat and friendly. - Encrypts URL in Wicket
Easy way to encrypt URLs in Wicket.
Model
Wicket model examples, to bind from components to object property, and vise verse.
- PropertyModel example
Uses PropertyModel to bind form components to object property. - CompoundPropertyModel example
Uses CompoundPropertyModel to bind form components to object property.
Form Components
Wicket form component examples.
- Textbox example
Uses TextField to render a username textbox, and attached a simple username validator. - Password field example
Uses PasswordTextField to render password field, and attached a strong password validator. - Textarea example
Uses TextArea to render a multi-lines address field. - Checkbox example
Uses Checkbox to render checkbox, and checked it by default. - Multiple checkboxes example
Uses CheckBoxMultipleChoice to render multiple checkboxes. - Radio buttons example
Uses RadioChoice to render a group of radio buttons. - Single select listbox example
Uses ListChoice to render a single select scrollable list. - Multi select listbox example
Uses ListMultipleChoice to render a multi select scrollable list. - Dropdown box example
Uses DropDownChoice to render a dropdown box options. - File upload example
Uses FileUploadField to render a file upload componenet. - Select and SelectOption example
Wicket extensions – uses “Select” and “SelectOption” to render a dropdown box, which group related options with <optgroup> tags. - Palette example
Wicket extension – uses “Palette” to render two select boxes, and allow user to move items from one select box into another.
Validators
Custom validator in Wicket.
- Create a custom validator
Example to create a custom validator. - Custom NotEqualInputValidator
Another custom validator to make sure two components are not equal.
Wicket Integration
Integrate Wicket with others.
- Wicket + Spring integration example
Example to integrate Wicket with Spring framework easily. - Wicket + Kaptcha integration example
Example to integrate Kaptcha with Wicket framework, via Spring. - Wicket + Log4j integration example
How to integrate log4j with Wicket, via slf4j-log4j bridge binding.
FAQs
Some common FAQs in Wicket.
- Change the html file location in Wicket
For some reasons, you want to separate java and html file into different folder, here are few ways to do it. - Get ServletContext in Wicket
ServletContext is useful to provide web information, show you how to get it in Wicket. - Change Wicket to deployment mode
Two ways to change Wicket from development mode to deployment mode. - Call Javscript after AJAX update
Show you how to run a Javascript code after ajax updated. - FileUpload validator is ignored
If no file is selected, FileUpload validator will not execute! solution. - Configure 404 error page in Wicket
How to configure a 404 error page for not found url. - Get root context of web application
Common way to get root context of your Wicket project. - Detect if browser supports JavaScript or Ajax
Wicket way to detect if browser supports JavaScript or Ajax - Add attribute to a HTML tag dynamically
Example to manipulate attribute in a HTML tag dynamically. - AjaxLazyLoadPanel in Wicket
Example to use AjaxLazyLoadPanel to enable the lazy load effect.
Common Errors
Some common error messages in Wicket.
- java.lang.ClassNotFoundException : org.slf4j.impl.StaticLoggerBinder
- Enable debug messages for org.apache.wicket.util.resource
Wicket References
- Apache Wicket official website
- Apache Wicket examples
- Apache Wicket Wiki documtation
- Apache Wicket APIs JavaDocs
What’s Next?
To study more topics on Wicket frameworks, I recommend below two great Wicket books.



In all honesty this is a wonderful detailed article nonetheless as with every great authors there are a few items that might be labored after. Yet by no means the actual much less it absolutely was intriguing.
Please teach me how to create Menu in wicket
Nice tutorial. Thanks for some easy to use ideas :-)
I’m stuck with the problem to display a grid of small pictures (used for a picture based captcha). The pictures are loaded randomly from the database. So I have each of them in a byte[] array and no clue how to display them in some kind of table or grid structure.
Any hint would be highly appreciated!
Best Regards
Hajo
Is it possible to do web service composition using wickets??
is it possibleto do web service composition using wickets
It sounds Netbeans has some problems with wicket. despite Netbeans Plug-in for wicket I couldn’t integrate wicket1.4 with spring . I try to solve this problem for more than one week .
In wicket-Srping MVC integration, can you tell me how to pass the control from wicket page to Spring Controller?
I have found that “org.apache.wicket.markup.html.resources” package is not available in the wicket-core library in wicket 1.5.3 plugin for netbeans 7.1.1.
Is there any way to add the package????????
I am using Netbeans 7.1.1 and i have installed Wicket 1.5.3 and I am a beginner. And find wicket easy to learn.
I am having a problem with a package. I used the package org.apache.wicket.markup.html.resources.StyleSheetReference but it is not recognized.