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

doubt on mock exam question

 
rachna jain
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
${not map.c}


there is a map
having

map.put("c" "42");


this evaluates to true.

I dont understand how?


Also


 
Himanshu Kansal
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Could you please tell where is this map, scope etc.

Regards
 
rachna jain
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ohh sorry its set in request scope


<%java.util.Map map = new java.util Hashmap;
request.setAttribute("map" map);

map.put("c" "42");%>
 
rachna jain
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All

Please see page 728 HFS for filter qno-1

can anyone explain what is callback and inline method for filter.


 
Himanshu Kansal
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try qualifying "map" for requestScope in that case like "requestScope.map"

Regards
 
rachna jain
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry i am unable to get you can you please clarify further
 
Alex Pustovit
Greenhorn
Posts: 10
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

the original question was quite interesting.
My explanations is: your put string 42 to the map. This value later is coerced to boolean using java.lang.Boolean.valueOf(STRING) function (see JSP 2.0 specification, page 116). Because mentioned function returns true only if STRING value is "true", you get the "false" value for expression map.c and finally true (${not map.c}) on your page.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic