Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFSJ Mock Exam question 60

 
Tyronne Fernando
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I couldn't any thread on this forum regarding question 60 from HFSJ mock exam. So, here goes.

The question is:

When comparing servlet initialization parameters to context initialization parameters, which are true for both? (Choose all that apply.)

A. In their respective DD tags, they both have a <param-name> and a <param-value> tag.

B. Their respective DD tags are both placed directly under the <web-app> tag.

C. Their respective methods used to retrieve initialization parameter values are both called getInitParameter.

D. Both can be directly accessed from a JSP.

E. Only changes to context initialization parameters in the DD can be accessed without redeploying the web application.

Answers A and C are given as the correct answers. How come D is not correct? JSP has access to both "application" and "config" implicit objects. Through them a JSP can access servlet initialization parameters and context initialization parameters.

Any suggestions? Thanks in advance.
 
Bennet Xavier
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tyronne Fernando,

Both servletcontext and servletconfig cannot be accessed in JSP.

servletcontext is application specific.

servletconfig is servlet specific. Only That particular JSP or servlet can access the init-param.

i think this will help you.

Thanks,
Bennet Xavier.X
[ December 15, 2008: Message edited by: Bennet Xavier ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic