File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ognl problem