• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

confusing question in HFSJ page 417

 
Sherif Shehab
Ranch Hand
Posts: 487
Android Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi pals,

in mock exams for chapter 8 (page 417) question number 2:

2 -given that web application stroes the webmaster email address in the servlet context initilaization parameter caled master-email. Whats retrieves that value?
a- <a href='${initParam.master-email}'> email me </a>
b- <a href='${contextParam.master-email}'> email me </a>
c- <a href='${initParam['master-email']}'> email me </a>
d- <a href='${contextParam['master-email']}'> email me </a>

right answer C (i'm not convinced i picked A )

Anyone got conviction
 
kalpana ram
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi sheriff,

The one thing we have to remember about dot operator is that,any thing after the dot operator , should follow java naming convention.
'-' is not allowed. and other thing is that in EL '-' is an minus operator.

Hence we have to use [] operator ,for an identifier that doesn't fit the java naming rules.correct one is ${initparam["master-email"]}


Hope this helps.
Kalpana.
 
Sherif Shehab
Ranch Hand
Posts: 487
Android Eclipse IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Opsssssssssssssssssssss , ya i forgot this .. :roll:

no i'm convincied , thanks for your reply..
 
Jonny Andersson
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But, is nesting of strings really allowed?

I could accept

or

but the nested strings as in the alternative C for question 2 at page 417 is hard to accept. And there is nothing about it in the errata for the book.
[ December 02, 2007: Message edited by: Jonny Andersson ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic