I am trying to use Mojarra 2.3.0-m02. Confirming the JSF configuration file faces-config.xml to be compatible with JSF 2.3 as follows.
<?xml version='1.0' encoding='UTF-8'?>
<faces-config version="2.3"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd">
</faces-config>
I am currently on a toy blank playground project having nothing other than a single XHTML file and one or two managed beans (CDI). No additional dependencies like PrimeFaces, OmniFaces.
The following
<h:outputText value="contextPath : #{request.contextPath}"/>
is evaluated to null
(empty string?). Reverting back the faces-config.xml file to be JSF 2.2 specific shows the correct context path as expected.
What is the culprit? (I am using GlassFish Server 4.1).
Additional:
I have used it the following way on the project's master template.
<ui:param name="contextPath" value="#{request.contextPath}"/>
and then used contextPath
in EL like #{contextPath}
at several places throughout the application.