Search code examples
javawicketprogram-entry-point

Wicket vs. main-method (how Wicket works?)


I am new to Wicket and would like to understand, how this framework works.

In normal Java application, the program counter starts in the main method. To understand the application from the beginning , I usually put eclipse break point at the beginning of this method and go step for step.

My Question is, when Wicket application is started, what happens first? How to follow the sequences in some Wicket application?


Solution

  • Wicket is a Java Web Application framework, so first you have to understand that a bit. For a start on that, have a look at the Java EE tutorial.

    Somewhere way up in the web application server, there is in fact a main method which is run when the server starts. But the connection to your web application written with Wicket is quite loose.

    When you write and build a wicket application, one of the things you do is to create a web.xml file that describes to the web application container how to load your application. This normally includes a reference to WicketFilter and a reference to your application's subclass of WebApplication.

    The WicketFilter class intercepts requests and sends them to your application.

    A more detailed description of this process is on the wiki page LifeCycle of a Wicket Application.