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

Ognl problem

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

I'm trying to populate a Map which is stored in a List (GridDataList) through ognl expression.

Please, see the code block.

//Action Class


//Ognl expression in the jsp.


I've a text field (named gridDataList[0].col1) on the jsp page, and on submission of the page, i want to populate the gridDataList(0)->Map with the key value pair(col1,san).


 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch!

Please UseCodeTags when posting code or configuration. Unformatted code and configuration is unnecessarily difficult to read. You can edit your post by using the button.

It's unclear to me what you're trying to do. If get(arg) gets anything above -1, it's going to call ArrayList.add(i, new HashMap()), which will add a hashmap to the array list as position i, enough times to reach arg. Forgetting, perhaps, that positions are 0-based so you'll "skip" a spot. No hashmap is being populated with any value (I think; it's hard to read).

So far there's nothing Struts-specific about this question, and no OGNL is shown in the code you've posted.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic