First off, do you have a 'public List getFiles()' in your action? The iterator 
tag looks for a getter that returns an object implementing java.util.List. For 
troubleshooting, I would put something static in your iterator tag just to see 
if the loop even starts (of course, sans getFiles(), you will see nothing).

-Wes 

-----Original Message-----
From: Marcos Mendonça [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 09, 2007 5:03 PM
To: user@struts.apache.org
Subject: s:iterator tag

Hello

I'm going crazy trying to use the s:iterator tag.

I have an action that generates an ArrayList of the files in a given directory.

In my JSP I'd like to show this files as a list.

Here's my action's code:

File dir = new File(props.getProperty("files.saveDir"));

FileFilter fileFilter = new FileFilter() { public boolean accept(File file) {
            return file.getName().endsWith(".gpx"); } };

File[] f = dir.listFiles(fileFilter);

ArrayList<File> files = new ArrayList(Arrays.asList(f));

return SUCCESS;

And the JSP code:

<s:iterator value="files">
    <s:property />
</s:iterator>


But it show absolutely nothing....
I tried using <s:property value="name"/> instead, but it doesn't work either. I 
also trying using JSTL's c:forEach with no success either.

I'm going desperate here, it should be so simple, yet nothing I tried works. 
Please, give me a hand.

Much appreciated.

Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to