aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Mock question-InitParameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Mock question-InitParameter" Watch "Mock question-InitParameter" New topic
Author

Mock question-InitParameter

Rancy Chadha
Ranch Hand

Joined: Jul 12, 2006
Posts: 135
Hi All,
Please help me out with this question:
What happens if you set a Web application-wide parameter through ServletContext, but don't provide a value?
A) This cannot happen.
B) An exception will be thrown.
C) Retrieving this parameter will return a string containing a servlet container version number.
D) Retrieving this parameter will return a string containing a servlet container name
Right answers are C & D.

I have tried this by not giving any value for <param-value> of <context-param> element. But I get blank I dont get the output that should be given as per this question. Probably I have not understood the question properly. Can anyone help me out with this?


Thanks,<br />-Rancy
Satya Maheshwari
Ranch Hand

Joined: Jan 01, 2007
Posts: 368
Could you please explain this line:
"set a Web application-wide parameter through ServletContext"

How is this done?


Thanks and Regards
Atul Sawant
Ranch Hand

Joined: Jul 06, 2006
Posts: 304
You are correct. When there is no value set for the parameter then you will see a 'blank'. I think the question means something else and i am not sure what it is trying to ask.


Mission SCWCD. Mission SCJP Complete: SCJP 1.4 - 91%
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
[Ranchy]:

I have tried this by not giving any value for <param-value> of <context-param> element. But I get blank I dont get the output that should be given as per this question.


Me too got the question in the same way as you. We get blank string.
If the question is something else, I am eager to know as well.



Thanks,


cmbhatt
 
 
subject: Mock question-InitParameter