Page service

The page service is used for basic navigation between pages in the application. The page service is tightly tied to the PageLink component.

A page service stores the name of the page as the single value in the service context.

The request cycle for the page service is relatively simple.

Figure 6.1. Page Service Sequence

Page Service Sequence

The URL contains the name of the page, and the corresponding page is aquired from the request cycle. The page is given a chance to validate that the user can access it, it can throw PageRedirectException to force a render of a different page. Otherwise, setPage() tells the request cycle which page will be used to render a response, and renderPage() peforms the actual render.