This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is param implicit object bean or Map(EL)?

 
Gowher Naik
Ranch Hand
Posts: 643
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Satou for reply
it means both param.name or param["name"] will invoke get("name").
is it so?
 
Ashwini Hegde
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • 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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic