You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Kevin HaleBoyes <kz...@yahoo.com> on 2002/11/07 21:49:26 UTC

need help with indexed properties

I have a Forms Bean

public class IndexedForm {
  private String items[] = new String[] {"one", "two"};
  public String[] getItems()          { return items; }
  public void setItems( String[] v )  { items = v; }
}

and a JSP page to display/edit the items:

<logic:iterate id="i" name="IndexedForm" property="items">
  <bean:write name="i"/>  <br>
  <html:text property="items" indexed="true"/>
</logic:iterate>

The <bean:write> tag displays the contents correctly but
the <html:text> tag doesn't.  Instead, I get
[Ljava.lang.String;@de530a
which looks like the "address" of the items array.

Why doesn't this work?

I've tried adding indexed getters and setters but that didn't
work.  I've also searched the archives since this seems like a
common problem but I've not come across an answer - similar things
but nothing that shed any light on my problem.
In fact this
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg47247.html
is very similar but there was never a reply to the last post.

I'm running Struts 1.1b2 on Tomcat 4.1.10.

I'm really at a loss and would appreciate any help.
Kevin.


__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>