Hi,

I would suggest experience or some insight to the requirements of struts2 that i don't have. yes, you can get my code, but since it is quite the same than some iterate-examples that work (at least if you follow their authors) that part should be correct.

the action:

   public class GetEntriesAction extends ActionSupport {
      public String execute() { return "success"; }
public ArrayList<EntriesBean> getEntries() {
         EntriesBean bean = new EntriesBean();
         bean.setAuthor("blubb");
         ArrayList<EntriesBean> ret = new ArrayList<EntriesBean>();
         ret.add(bean);
         return ret;
      }

      public List<String> getTest() {
         ArrayList<String> ret = new ArrayList<String>();
         ret.add("hello1");
         ret.add("hallo2");
         return ret;
      }
   }

The Entries-Class

   public class EntriesBean {
      private String author;
public String getAuthor() { return author; }
   }

The JSP

|<s:iterator value="entries" id="curEntry">
  <s:property value="author" /></td>
  objecttest
</s:iterator>
<s:iterator value="test" id="curtest">
  <s:property />
  stringtest
</s:iterator>|

The test with the stringarray works, the test with the entries class doesnt.

I created the project by importing the blank 2.0.11 war into eclipse. maybe that helps too.

Greetings,
Alex

PS: short link to the example i was using http://www.struts2.org/struts2-control-tags-using-iterator-tag/


Dave Newton schrieb:
--- On Fri, 6/13/08, Alexander Bätz <[EMAIL PROTECTED]> wrote:
i'm making my first steps with struts and currently
i'm testing the s:iterate tag. Unfortunately my test wont work.

at first i created an action with a getter that returns a
ArrayList of a special class. then i tried to iterate  over that list.

at first nothing happend. the tag didnt work, neither for
my list of objects nor for a simple list of strings. Then i added the
jar of commons-collection to my build path an now it will at least
iterate over strings.

can somebody help?

How? What would we use to diagnose the problem?

Dave


---------------------------------------------------------------------
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