• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Doubt in EL Implicit Objects

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

Name: <input type = "text" name = "name">

FirstFood: <input type = "text" name = "food">
SecondFood:<input type = "text" name = "food">

Can you clarify me whether the EL representation is possible using [] in the above given food case using paramValues.

Please also let me know the equivalent for ${param.name} and ${paramValues.food[0]} using [] representation?
 
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

Can you clarify me whether the EL representation is possible using [] in the above given food case using paramValues.


Yes, it's possible, but I'm not sure that the order will be guaranteed. So paramValues.food[0] does not necesseraly return FirstFood's value. You'll have to check that.

Please also let me know the equivalent for ${param.name} and ${paramValues.food[0]} using [] representation?


${param["name"]} and ${paramValues["food"][0]}
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Yes, it's possible, but I'm not sure that the order will be guaranteed. So paramValues.food[0] does not necesseraly return FirstFood's value. You'll have to check that.


I'm pretty sure you are correct, Christophe.

It's typically a bad idea to have textfields with the same name.
 
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The order should be preserved in the posting of the name/value pairs
 
Sometimes you feel like a nut. Sometimes you feel like a tiny ad.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic