This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Ognl problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Ognl problem" Watch "Ognl problem" New topic
Author

Ognl problem

abhisan sharma
Greenhorn

Joined: Jul 20, 2010
Posts: 1
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

Joined: Sep 29, 2008
Posts: 12617

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.
 
 
subject: Ognl problem
 
Similar Threads
DisplayTag + PaginatedList + Struts2
createNativeQuery Question
Iterating over Map using JSTL
ONGL Question
Exam Qs- collection- help!