...
- Calls the overridable method
onBeginRequest()
to allowRequestCycle
subclasses to do things at the beginning of each request, such as opening a Hibernate session. - 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.
- Resolves the
IRequestHandler
to handle the request. - Calls any listeners to
onRequestHandlerResolved
- Calls
requestHandlerExecutor.execute(handler);
which in turn callsIRequestHandler.respond()
. See API for a list of implementations. - Calls any listeners to
onRequestHandlerExecuted
- Calls Calls the overridable method
onEndRequest()
to allowRequestCycle
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:
- Calls onBeginRequest() for every Component on the Page, giving each Component a chance to alter itself before rendering begins.
- Renders the Page by calling Page.render().
- If the Application for the Page has component checking enabled in its ApplicationSettings, checks that each component rendered.
- 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.
...