Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ognl problem

 
abhisan sharma
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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).


 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic