struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcos Mendonça" <marc...@gmail.com>
Subject s:iterator tag
Date Thu, 09 Aug 2007 21:02:48 GMT
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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message