• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFSJ Chapter 8 ,Question 7,page number 428

 
shanthisri mocherla
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends

which statements about the .dot and[]EL operators is true??

Is it correct or wrong???
In the book it is given that it is wrong!!
I thoght the answers are B,C,E and F.
Thank you very much
[ November 02, 2005: Message edited by: shanthisri mocherla ]
 
Radhika Jonnalagadda
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Shanthi,



This is wrong because "${header.User-Agent}" is subtracting 'Agent' from 'User'.The second statement runs fine.Hope this information helps.
best regards,
Radhika
 
shanthisri mocherla
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Radhika
Thank you for your reply. I think that User-Agent does not follow the java naming rules in the first statement.Am I right.??
${header.User-Agent} is in-correct.-first statement.
${header["User-Agent"]} is correct-second statement.

Thank you very much
Shanthi
 
Rizwan Mohammad
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. When names doenst follow java standards you have to use [] operator instead of . operator. This is one of the benefits of using [] operator over . operator.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic