RE: need help with indexed properties

2002-11-07 Thread Karr, David
> -Original Message-
> From: Kevin HaleBoyes [mailto:kzboyes@;yahoo.com]
> Sent: Thursday, November 07, 2002 12:49 PM
> 
> 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:
> 
> 
> 
>   
> 
> 
> The  tag displays the contents correctly but
> the  tag doesn't.  Instead, I get
> [Ljava.lang.String;@de530a
> which looks like the "address" of the items array.

First of all, if you use indexed tags, you have to implement indexed
getters and setters.  Second, you probably intend for each of your
"html:text" elements to display one element in your iteration.
Therefore, the "property" on the "html:text" will likely match the value
of your "id" attribute in your "logic:iterate" tag.

I don't remember what examples of indexed tags are in the distribution,
but if you download the nightly build, you can find an example in the
"strutsel-exercise-taglib" application in the Struts-EL contribution.
The JSP file is "html-indexed.jsp", and it uses the "TestBean" class.

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




need help with indexed properties

2002-11-07 Thread Kevin HaleBoyes
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:



  


The  tag displays the contents correctly but
the  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:   
For additional commands, e-mail: