Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

one doubt in EL implicit object

 
BO KANG
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey,ranchers:

I have one doubt in the chapter Scriptless JSP in HFSJ .The second question in the mock exam in this chapter:

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

Which retrieves that value:

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

but i think the option A is correct as well :

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

??

Thanks
 
Kathiresan Chinnasamy
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

This is wrong {initParam.master-email}'...
because master-email is violating java naming standards
 
Kathiresan Chinnasamy
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you have to follow java naming standards If you use . operator instead of [] in EL
 
BO KANG
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
O,OK,thanks a lot ,forget that...
 
Mitch Miller
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I missed that too.

Key is looking for '-' in variable name.

If it has '-' you cannot use '.' because it is interpreted as "minus."
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic