I have a authorization managed bean to fetch restriction rules to be applied to the tags within every jsf of the application. The managed bean requires to know the name of the requested jsf on initiation so it can fetch restrictions specific to the tags within that jsf. What is the best way this can be achieved ?
Asked
Active
Viewed 2,582 times
1
-
Which JSF version? Where are those init params to be stored? web.xml? – BalusC Dec 17 '10 at 02:39
2 Answers
2
Declare it in web.xml as follows:
<context-param>
<param-name>paramName</param-name>
<param-value>PARAM_VALUE</param-value>
</context-param>
Access it in ManagedBean as follows:
FacesContext.getCurrentInstance()
.getExternalContext().getInitParameter("paramName")
Hope this helps to solve your problem.

Krishna
- 7,154
- 16
- 68
- 80
1
You can get init-param
s defined in web.xml by:
FacesContext.getCurrentInstance().getExternalContext()
.getInitParameter("paramName");

Bozho
- 588,226
- 146
- 1,060
- 1,140