concept page in category seam

This is an excerpt from Manning's book Seam in Action.
The two main technology choices in a Seam application, summarized in figure 1.3, are the state provider and the persistence provider. The state provider is the technology that handles the application logic and responds to events in the UI. The persistence provider transports data to and from persistence storage. Seam manages the persistence provider to allow for the persistence context to be extended across a series of pages and shared among multiple components.
The most common form of security in a web application is page-level security. Even when we get into securing components later on, the web layer still needs to be involved to direct the user to the login page or an error page when the user is denied access to a resource. In this section, you’ll learn why page-level security has traditionally been so difficult to enforce in JSF and the solution that Seam offers. You’ll then explore a couple of Seam’s page-level security features and how to use them to protect pages and serve them securely.
If a scheme isn’t specified for a view ID, Seam sticks with the scheme from the previous request. Therefore, if you mark the login page to be served securely, and no other pages have a scheme set, the user becomes permanently stuck in HTTPS after a trip to the login page. If your application doesn’t require SSL across the board, it’s better for performance to revert back to HTTP to serve low-risk pages. Since Seam issues a redirect to the scheme defined for a page if the wrong scheme is requested, this setting can be used to switch back to a nonsecure line. Use the following configuration to have all pages without a scheme defined served over HTTP:
<page view-id="*" scheme="http"/>You may wonder how Seam knows how to modify the URL. In the default configuration, it’s quite simple. Going from nonsecure to secure, Seam simply changes the beginning of the URL from http to https, and vice versa. That works as long as the server uses the standard scheme-to-port mapping (port 80 for HTTP and port 443 for HTTPS). If you’re using different ports, then you need to let Seam know what the port numbers are. First, add the component namespace http://jboss.com/products/seam/navigation, prefixed as navigation, to the component descriptor. Next, configure the built-in component named pages to set the ports: