Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

getInitParameter

 
muthu moorthy
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any body can help me to find out the two possible answers ?

One is, B other one ?

Thank you


Problem

Which of the following lines can be used to retrieve a servlet initialization parameter "dbname" from the init() method of a servlet?



Code

public void init()
{
String dbname = //1 : Insert line here
}




Options

Select 2 correct options.

a. getServletConfig().getParameter("dbname");

b. getServletConfig().getInitParameter("dbname");

c. getServletContext().getInitParameter("dbname");

d. getInitParameter("dbname");

e. getInitParameterValue("dbname");
 
Rohitt Vermaa
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
d
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!