1.

How To Access Web.xml Init Parameters From Java Code?

Answer»

You can get it USING externalContext getInitParameter METHOD. For example, if you have:
connectionString JDBC:oracle:thin:scott/tiger@cartman:1521:O901DB
You can access this CONNECTION STRING with:
FacesContext fc = FacesContext.getCurrentInstance();
String connection = fc.getExternalContext().getInitParameter("connectionString");

You can get it using externalContext getInitParameter method. For example, if you have:
connectionString jdbc:oracle:thin:scott/tiger@cartman:1521:O901DB
You can access this connection string with:
FacesContext fc = FacesContext.getCurrentInstance();
String connection = fc.getExternalContext().getInitParameter("connectionString");



Discussion

No Comment Found