Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: formatting changes + change to How Page Handles a Request

...

  1. Calls the overridable method onBeginRequest() to allow RequestCycle subclasses to do things at the beginning of each request, such as opening a Hibernate session.
  2. Parses the request and potentially invokes user request handling code. If request handling sets the responsePage property of the RequestCycle, the request() method is called on the response page.
  3. Resolves the IRequestHandler to handle the request.
  4. Calls any listeners to onRequestHandlerResolved
  5. Calls requestHandlerExecutor.execute(handler); which in turn calls IRequestHandler.respond(). See API for a list of implementations.
  6. Calls any listeners to onRequestHandlerExecuted
  7. Calls Calls the overridable method onEndRequest() to allow RequestCycle subclasses to do things at the end of each request, such as closing a Hibernate session.

Step 2 3 may involve some pretty sophisticated logic. When a request URL is parsed, it may include information such as a Component listener
to invoke. This Component listener may create a whole new Page that is used

How Page Handles a Request

Page.request(), called in step 2 above, performs the following 3
steps to handle a request:

  1. Calls onBeginRequest() for every Component on the Page, giving each Component a chance to alter itself before rendering begins.
  2. Renders the Page by calling Page.render().
  3. If the Application for the Page has component checking enabled in its ApplicationSettings, checks that each component rendered.
  4. Calls onEndRequest() for every Component on the Page.

Once step 2 begins (the render phase for the Page), the Page becomes immutable and it is no longer valid to alter either the Page's component hierarchy or the values of any of its models. Attempting to change the Page during rendering will generally result in a runtime exception.

Clustering

When a Page is replicated from one machine in a cluster to another, the onSessionAttach() method will be called for every component on the Page.

...