JSF 2 – How can I get a context-param value from web.xml using JSF EL?

Steve Taylor’s answer does indeed work, but there is a simpler way using the JSF EL pre-defined object initParam.

<h:outputText value="#{initParam['myconstantkey']}" />

Originally this wasn’t working for me because I forgot to put the single quotes around the key name and was getting back an empty string. This solution should also work with key values that contain dot characters.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)