aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes In HFS mock exam chapter 8 Pg 417 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "In HFS mock exam chapter 8 Pg 417" Watch "In HFS mock exam chapter 8 Pg 417" New topic
Author

In HFS mock exam chapter 8 Pg 417

Senthil Kumar N
Greenhorn

Joined: Nov 30, 2004
Posts: 19
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

Joined: Dec 08, 2004
Posts: 10
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

Joined: Sep 28, 2002
Posts: 63
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: In HFS mock exam chapter 8 Pg 417