Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

There is a number of classes involved in request processing. The most important ones are: #WebApplication, #WebRequest, #WebResponse, #WebSession, #RequestCycle, #IRequestCycleProcessor, #IRequestCodingStrategy and #IRequestTarget. Below there are short descriptions of these classes which says say what this class for, when it is created, how you can get its it instance(s). You can skip the descriptions and look at the sequence diagram at the bottom.

Panel
bgColor#FFFFFF
titleRelation between classes involved in request processing
borderStyledashed

Image Added

Anchor
WebApplication
WebApplication

WebApplication contains some classes (such as IRequestCycleProcessor) which are essential for request processing. It is also used for storing application scope data such as Settings and SharedResources.
WebApplication is created when WicketFilter/Servlet is initialized. It is created by IWebApplicationFactory which can be specified in the web.xml using applicationFactoryClassName parameter:

...

Anchor
RequestCycle
RequestCycle

RequestCycle does some general request processing and delegates most of it request processing to IRequestCycleProcessor (see RequestCycle#step()). Besides that RequestCycle also contains instances of WebRequest, WebResponse which basically wraps HttpServletRequest and HttpServletResponse adding Wicket related functionality. Instances of all these classes are created on every request.
This is a pseudo code of how RequestCycle is created:

...

On the whole request processing looks roughly like this. Here RequestCycle gets the request() message from WicketFilter/Servlet. The main idea behind the diagram is that requested URL is transformed into RequestParameters and then using it IRequestCycleProcessor creates IRequestTarget object and delegates to it events event processing and rendering. Note that event processing happens before rendering. That is why if a page is changed in event handling code, those changes are visible in the rendering phase.

Panel
bgColor#FFFFFF
title
borderStyledashed

Image Modified