• Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubt regarding EL

 
Jacob Thomas
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a top level class called Directory which contains a Set of Folder Objects. In the Folder class, I have another Set of objects called SubFolders. In the SubFolder class, I have properties like fileName, fileSize, uploadDate etc. All of the above classes are modelled as Javabeans with getter and setter properties.

Hierarchically, it is represented as:

Directory----->Folder------>SubFolder.

How can I access the fileName property using EL? Any help is appreciated. Thanks!!!
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure it will work with Set. You should use List or an array instead.

Then, assuming that variables are respectively called directory, folder and subfolder :
directory.folder[0].subfolder[0].fileName

You have to use indexes to access the folders and subfolders.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, tell me how will you go in scriplets?

And yes, List would be more appropriate candidate. Any reasons for using a Set?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!