Configure and build apache wicket without maven. A hello world example.

In my earlier tutorial, we have seen how to build a sample  wicket application with the help of mavan. In this tutorial, let us see how to configure and create a apache wicket hello world application in eclipse without using maven in easy steps

Tools used in this tutorial to configure apache-wicket project

1. Apache Wicket 6.16
2. Java : Java 1.6 or above
3. Eclipse with Apache server

Minimum Jars required used in this tutorial for starting this simple wicket project.

1. log4j-1.2.16.jar
2. slf4j-api-1.6.4.jar
3. slf4j-log4j12-1.6.4.jar
4. wicket-core-6.16.0.jar
5. wicket-request-6.16.0.jar
6. wicket-util-6.16.0.jar

#Your project may require more wicket jars depending upon your requirement to do more tasks.

Apache Wicket 6.16.0 can be downloaded from the apache site http://www.apache.org/dyn/closer.cgi/wicket/6.16.0. Unzip the downloaded apache-wicket-6.160.zip

Step 1: Open eclipse and create a dynamic web project using File->New->Dynamic Web Project
give the project name WicketTest and then click next…and finish

The initial directory structure in the eclipse will be as given below

wicket eclipse structure

Step 2: Get all the jars mentioned above from the unzipped folder and copy to the WEB-INF\lib folder…

Step 3: Replace the web.xml file located in the folder (\WEB-INF) with the below web.xml file.

web.xml

The above web.xml is configured for the filter class (org.apache.wicket.protocol.http.WicketFilter) of any wicket application

Step 4 : Create Sample Java class and html files using wicket which are given below.

WicketStarter.java

FirstPage.java

FirstPage.html

SecondPage.java

SecondPage.html

Step 5: Put all the above files under src\com\javaonline

Note :html file name should be same as the java file name.

Step 6: Include the src folder (WicketTest\src) in the class path.

Final directory structure of the web application created in this tutorial is given below.

wicket eclipse complete structure

Now run the project and get the below output

wicket home

 

Click on the link Hello World, you will get the below output page.

wicket second page

Reference:

Wicket start

wicket link

 

You may also like

Leave a Reply

1 Comment on "Configure and build apache wicket without maven. A hello world example."


Guest
saasivarma
1 year 3 months ago

HI VK,
I have tried your example. But i got this error on browser when i run it.

Unexpected RuntimeException
WicketMessage: Unable to create page from class com.varma.FirstPage. Class does neither have a constructor with PageParameter nor a default constructorRoot cause:org.apache.wicket.WicketRuntimeException: Unable to create page from class com.varma.FirstPage. Class does neither have a constructor with PageParameter nor a default constructor at org.apache.wicket.session.DefaultPageFactory.newPage(DefaultPageFactory.java:68) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:298) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:320) at org.apache.wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:234) at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92) at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250) at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329) at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436) at org.apache.wicket.RequestCycle.request(RequestCycle.java:545) at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486) at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

Page
[Stateless Page]:

# Path Size Type Model Object

Can you help out to resolve this issue.

Thanks in Advance: ) : ) : ) : )