File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Ognl problem" Watch "Ognl problem" New topic

Ognl problem

abhisan sharma

Joined: Jul 20, 2010
Posts: 1

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

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:
subject: Ognl problem
It's not a secret anymore!