Help coderanch get a
new server
by contributing to the fundraiser
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

is param implicit object bean or Map(EL)?

 
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have a html page


Now jsp file for above html file is

now param implicit is bean so we can write
${param.name} which will display name.
Then how can we write
${param["name"]}
Because ${param["name"]} is used for Map where param is bean.


Please help
Thanks
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
param is a Map, not a bean.
So calling param.name will invoke get("name") on the map.
[ November 27, 2006: Message edited by: Satou kurinosuke ]
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Satou for reply
it means both param.name or param["name"] will invoke get("name").
is it so?
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The dot(.) opearator can be used with maps and beans. When used with a map, the name to the right of the operator is the key in the map, whereas when used with a bean, the value to the right is the name of the property in the bean we are trying to access.

The [] operator can be used in all cases where the (.) operator is used. In addition, it can also be used in cases where the left had side of the [] operator is an arrya or a list.

And yes, as already stated, param is a map not a bean. The only implicit object in EL implicit objects list that is a bean is the pageContext. All the others are map objects.

so, param["name"] and param.name will return the same result.
[ November 27, 2006: Message edited by: Ashwini Hegde ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic