After JSF 2, it is very easy to provide navigation in a controller. In the BasicFlow
controller from the earlier JSF example, we relied on implicit page navigation. The developer can specify the next page to render simply by returning a simple string.
Here is the controller class again:
@Named @RequestScoped public class BasicFlow { public String serveResponse() { return "endState.xhtml"; } }
In JSF 1, the page navigation was determined explicitly in a Faces Configuration XML file: /WEB-INF/faces-config.xml
, which made the development harder because of the enforced cognitive indirection. The purpose of faces-config.xml
is to define the configuration for a JSF web application. The developer can define the navigation rules, inject bean properties, define the properties file, and declare the resource bundles and locales. They can register the converters, validators, and renderer components.
Explicit page navigation is useful for the defined information architecture...