• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

doubt on mock exam question

 
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


 
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
 
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.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic