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

Single String Parameter Values?

 
Xiaoxiao Lam
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I don't know if it's because my English is not good, I don't understand this sentence which is one of the right statements about EL implicit objects:

"The implicit object param is a Map that maps parameter names to single String parameter values."

What does the "single" word mean here? Does it mean only one value for each name? (If so, I don't think this statement is right.) Or it means that the values can't be String array? Maybe this is a silly question, but I am really confused. Thank you.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"The implicit object param is a Map that maps parameter names to single String parameter values."

It means : One paramter name returns one String.
It simply calls ServletRequest.getParameter(String name), which returns only one String. (the first one of the array if there are several)

If you want to get all values, you should use the implicit object "paramValues".
 
MInu
Ranch Hand
Posts: 517
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My understanding is,

Param is a map (name value pair).

The implicit object param is used when there is one value(single parameter value) for one param name(single parameter name).

If you have multiple values for a single parameter name ,then you can use paramValues implicit object.

Thanks...
 
Xiaoxiao Lam
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understand now. Thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic