Tuesday, 7 May 2013

How to access web.xml init parameters from jsp page? | JSF Interview Questions

You can get it using initParam pre-defined JSF EL valiable.
For example, if you have:
<context-param>
<param-name>productId</param-name>
<param-value>20044</param-value>
</context-param>
You can access this parameter with #{initParam['productId']} . For example:
Product Id: <h:outputText value="#{initParam['productId']}"/>


No comments: