• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

In HFS mock exam chapter 8 Pg 417

 
Senthil Kumar N
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given that a web application stores the webmaster email address in the servlet context initialization parameter called master-email.

which retrieves that value?

1 <a href='mailto:${initParam.master-email}'> email me</a>

2 <a href='mailto:${contextParam.master-email}'> email me</a>

3 <a href='mailto:${initParam['master-email']}'> email me</a>

4 <a href='mailto:${contextParam['master-email']}'> email me</a>

which answer is correct i just want to know bert. Can u tell the answer. Answer is given as option 3.
 
liny
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Senthil Kumar N:
Given that a web application stores the webmaster email address in the servlet context initialization parameter called master-email.

which retrieves that value?

1 <a href='mailto:${initParam.master-email}'> email me</a>

2 <a href='mailto:${contextParam.master-email}'> email me</a>

3 <a href='mailto:${initParam['master-email']}'> email me</a>

4 <a href='mailto:${contextParam['master-email']}'> email me</a>

which answer is correct i just want to know bert. Can u tell the answer. Answer is given as option 3.


That's true the answer is 3.
You can write EL like that!
But option 1 is wrong, because the right of dot must follow the java naming rule!
 
chandana sapparapu
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, there is a very minor mistake with option 3, and shud be covered in errata.

<a href='mailto:${initParam['master-email']}'> email me</a>

Notice the single quotes.
It should have been

<a href="mailto:${initParam['master-email']}"> email me</a>

or

<a href='mailto:${initParam["master-email"]}'> email me</a>

I feel the actual option 3 may fail because of its syntax(all single quotes). Doesn't it? Please let me know if anyone knows the answer for sure.

Thanks



Given that a web application stores the webmaster email address in the servlet context initialization parameter called master-email.

which retrieves that value?

1 <a href='mailto:${initParam.master-email}'> email me</a>

2 <a href='mailto:${contextParam.master-email}'> email me</a>

3 <a href='mailto:${initParam['master-email']}'> email me</a>

4 <a href='mailto:${contextParam['master-email']}'> email me</a>

which answer is correct i just want to know bert. Can u tell the answer. Answer is given as option 3.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic