• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EL doubt

 
Joshua Antony
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When using ${header["user-agent"]} I get output of Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)

However if I use ${header.user-agent} I get output of '0'.
What may be the problem?

Regards,
Joshua
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

That's right, you have to get the output 0, because EL is null friendly and treats unknowns as 0 in Arithmetic and as false in boolean operations.

It's like you are trying to subtract agent from user, and they are unknowns, so the container is doing 0 - 0 which is equal to 0.

I hope that this made everything clear.

Best of luck ...
 
Joshua Antony
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Vladimir, I got the point.

Regards,
Joshua
 
Vassili Vladimir
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad to help

Regards ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic