How to setup Wicket Examples in Eclipse

Wicket examples is a good place to learn Apache Wicket by examples, and a must reference site for new or experienced Wicket’s developers. In this Wicket examples site, it almost contains all of the usage of the common wicket’s components.

In this guide, we show you how to setup the above Apache Wicket example site in your local development environment (Eclipse IDE).

Tools used :

  • Apache Wicket 1.4.17
  • Eclipse 3.6
  • Maven 3

1. Download Source Code

Download Apache Wicket 1.4.17 from http://wicket.apache.org/. The Wicket example code is packaged inside the “src” folder.

2. Review Directory

Extracts the downloaded Wicket zip file, review the directory structure. The folder “wicket-examples“, which inside the “$WICKET_PATH/src” folder is what you need.
wicket example folder structure

3. Maven Build

Navigate to the “wicket-examples” folder , compile and build with Maven, and make it support Eclipse WTP features.

$WICKET_EXAMPLE_FILE_PATH> mvn eclipse:eclipse -Dwtpversion=2.0

P.S Maven will configure the project and download the project dependencies automatically.

4. Eclipse Project + WTP

Import the project into Eclipse IDE (you should know how :)).

However, in Wicket 1.4.17, the Maven “-Dwtpversion=2.0” option seem not working in my Eclipse 3.6, because i noticed Eclipse facets files and deployment dependency libraries are not configure properly. If you have the same problem, do following steps :

  1. Right click on project –> Properties –> “Project Facets“. Select “Dynamic Web Module” and “Java“.
    wicket example eclipse facets

  2. Same windows –> Select “Deployment Assembly“, make sure the libraries and root deploy path “/” are configured properly. Just add it if it’s missing.
    wicket example eclipse depoyment dependency

5. Deploy + Test

In Eclipse IDE, create a Tomcat instance, assigned your configured “wicket-example” project to the new Tomcat instance and start it.

Visit this URL : http://localhost:8080/wicket-examples/

wicket example cloned site

Done. The entire wicket examples site is cloned into your local development environment.

转载于:https://www.cnblogs.com/ghgyj/p/4765406.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值