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 Struts OGNL how to acces vector elements 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 "Struts OGNL how to acces vector elements" Watch "Struts OGNL how to acces vector elements" New topic
Author

Struts OGNL how to acces vector elements

Andrei Antonescu
Ranch Hand

Joined: Jul 08, 2010
Posts: 75
Hello,

I have smth like this: an ArrayList. Each list element contains another ArrayList. Each sub arrayList contains Object with propertis: prop1, prop2 etc.
How can I access a property like that from OGNL?

Ex:


I want to write this (in OGNL): x.get(0).get(0).y;

Thanks.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

Do you want to iterate over the elements or just display the value of x.get(0).get(0).y ??


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Andrei Antonescu
Ranch Hand

Joined: Jul 08, 2010
Posts: 75
Hello again,
I want only to display the elements.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts OGNL how to acces vector elements
 
Similar Threads
How to access static fields using OGNL in Struts 2
Sudoku solver help (not brute force)
how to compare if object exists in arraylist and add if doesn't
How to compare a Short with 1 in OGNL (Struts 2)
HashMapping