jsr372-experts@javaserverfaces-spec-public.java.net

[jsr372-experts] Re: Exact mapping [Spec PDF]

From: arjan tijms <arjan.tijms_at_gmail.com>
Date: Fri, 13 Jan 2017 01:58:00 +0100

Here's the text to be added to the spec PDF, 7.6.2.3 at the start of the
section for the getActionURL() requirement, right above "If prefix mapping
(such as “/faces/*”) is used"

"If exact mapping (such as “/foo”) is used for FacesServlet, the following
algorithm must be followed to derive the result.

Retrieve the collection of existing mappings of the FacesServlet, e.g.
using ServletRegistration#getMappings(). Let this be facesServletMappings.
If the argument viewId has an extension, then obtain the value of the
context initialization parameter named by the symbolic constant
ViewHandler.FACELETS_SUFFIX_PARAM_NAME. (if no such context initialization
parameter is present, use the value of the symbolic constant
ViewHandler.DEFAULT_FACELETS_SUFFIX). Let this be faceletsDefaultSuffix.

Obtain the value of the context initialization parameter named by the
symbolic constant ViewHandler.DEFAULT_SUFFIX_PARAM_NAME (if no such context
initialization parameter is present, use the value of the symbolic constant
ViewHandler.DEFAULT_SUFFIX). Let this be defaultSuffixes.

Add faceletsDefaultSuffix to defaultSuffixes.

For each entry in the list from defaultSuffixes, if the extension of the
argument viewId is equal to this entry, remove the extension from viewId.
For discussion, call this candidateViewId.

Look if the candidateViewId is present in facesServletMappings. If so, the
result is contextPath + candidateViewId.
If the argument viewId has no extension, then look if the viewId is present
in facesServletMappings. If so, the result is contextPath + viewId.

If no result has been obtained, pick any prefix mapping or extension
mapping from facesServletMappings. If no such mapping is found, throw an
IllegalStateException.

If such mapping is found remove the "*" character from that mapping, take
that as the new mapping and continue with evaluating this mapping as
specified below for "if prefix mapping [...] is used" and for "if suffix
mapping [...] is used"
"

Kind regards,
Arjan Tijms