Download Android App in your Android Device from Google Play Store
- Search for "Withoutbook Practice Exam Test" in Mobile/Tablet Play Store
Practice InterviewNew Search by Name or Email

Exams Attended

Make Homepage

Bookmark this page

Subscribe Email Address

JSF Interview Questions and Answers

Ques. How to access web.xml init parameters from java code?
Ans. You can get it using externalContext getInitParameter method. For example, if you have:

<context-param>
<param-name>connectionString</param-name>
<param-value>jdbc:oracle:thin:scott/tiger@cartman:1521:O901DB</param-value>
</context-param>
You can access this connection string with:

FacesContext fc = FacesContext.getCurrentInstance();
String connection = fc.getExternalContext().getInitParameter("connectionString");
Is it helpful? Yes No

Most helpful rated by users:

©2020 WithoutBook