Other configuration elements
Overview
A page flow file is comprised of three sections:
The
<files>
elements list files that must be served directly to the client, such as images or CSS files.The
<page>
elements declare pages and for each one specify identifier, path, model, view, and XML submission.The
<epilogue>``, <not-found-handler>
,<unauthorized-handler>
and<error-handler>
elements define additional behavior that apply to all the pages.
The files element
Some files are not dynamically generated and are served to the client as-is. This is typically the case for images such as GIF, JPEG, CSS files, etc..
You tell the PFC what files to serve directly with one or more <files>
elements in the page flow. The example below shows the configuration used by the Orbeon Forms examples:
With <files path="*.gif">
, if a request reaches the PFC with the path images/logo.gif
, the file oxf:/images/logo.gif
is sent in response to that request.
The epilogue element
This is an example of <epilogue>
element, pointing to the default epilogue XPL pipeline:
The not-found-handler element
The <not-found-handler>
element is used to specify a page (the "not found" page) to call when no <page>
element in the page flow is matched by the current request. There can be only one <not-found-handler>
per page flow.
The "not found" page is also run by the PFC when a page throws an exception denoting that a resource has not been found:
HttpStatusCodeException
with code 404ResourceNotFoundException
The "not found" page does not run for resources served through the <files>
element. In that case, the PFC returns instead a "not found" code to the user agent (code 404 in the case of HTTP).
This is an example of <not-found-handler>
element and the associated <page>
element:
By default, oxf:/config/not-found.xhtml
displays a simple XHTML page telling the user that the page requested cannot be found.
NOTE: The "not found" page does not run for resources served through the <files>
element. In that case, the PFC returns instead a "not found" code to the user agent (code 404 in the case of HTTP).
The unauthorized-handler element
The <unauthorized-handler>
element is used to specify a page (the "unauthorized" page) to call when an unauthorized condition has taken place. Specifically, this happens when a page throws an exception:
HttpStatusCodeException
with code 401 or 403
Example:
This is an example of <unauthorized-handler>
element and the associated <page>
element:
Error handling and the error-handler element
Several things can go wrong during the execution of a page flow by the PFC, in particular:
An action, page model, page view or epilogue may generate an error at runtime.
The page flow may be ill-formed.
Errors occurring while running a given page (#1 above) can be handled via the <error-handler>
element. This works in a way very similar to the <not-found-handler>
element: