Wicket examples is a baby step to learn about wicket, and a must reference site for all new or experience wicket’s developers. In wicket examples , it’s almost contains all of the wicket’s component usage.

Wicket’s examples

http://www.wicketstuff.org/wicket13/

Well, it will be better if we can setup a wicket example in our local developement environment as reference.

How do configure the wicket examples site in our local eclipse environment?

1. Download and configure maven properly http://maven.apache.org/

2. Download latest wicket released http://wicket.apache.org/

3. Extract the downloaded wicket files. e.g apache-wicket-1.4-rc1.zip

4. Copy the wicket-examples folder to a new location, avoid to mess up the original source. e.g

d:\wicket-examples

5. Access the d:\wicket-examples, and type following maven command

d:\wicket-examples> mvn eclipse:eclipse -Dwtpversion=1.5

P.S This command tell maven to create an eclipse web project for wicket examples. Maven will automatically download all the wickets’ dependency libraries. I like this feature ~

6. In Eclipse IDE, Select File–>Import…–>Existing Projects into Workspace (under General folder), click next and Browse to wicket web project folder you created just now.

7. Configure M2_REPO classpath variables
- Click windows –> reference
- Java –> Build Path –> Classpath Variables –> Click New button and select your maven local repository.

P.S mvn eclipse:eclipse will create all wickets’ dependency libraries in .classpath file and prefix with M2_REPO variable, we have to configure this M2_REPO , else we can not locate the libraries.

8. Create a new tomcat server and select the wicket-examples project

9. Start tomcat server and type http://localhost:8080/wicket-examples/ in your browser.

Done. we had clone the whole wicket examples site into our local development environment (Eclipse), it’s even included all the wickets’ example source code for quick reference.

Happy wicket coding ~

Q & A

Question : After deployed wicket examples, i hit the wicket HTML files missing or not found exception while accessing the wicket examples site. Is this a wicket source code error?

Answer : No really wicket problem. I had encountered the same error in my old Eclipse IDE as well. This may cause by the Eclipse default resourceCopyExclusionFilter setting (HTML file filter by default).Please explicit the file type we want to filter in org.eclipse.jdt.core.prefs file under setting folder.

Copy following code and append to org.eclipse.jdt.core.prefs file.

org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch,*.testsuite,*.deploy,
*.location,*.execution,*.datapool,*.artifact,*.svg

P.S Latest Eclipse IDE do not have this problem.

This article was posted in Wicket category.