aspose file tools*
The moose likes Struts and the fly likes Input ActionForm has a field containing an array of javabean, will it work? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Input ActionForm has a field containing an array of javabean, will it work?" Watch "Input ActionForm has a field containing an array of javabean, will it work?" New topic
Author

Input ActionForm has a field containing an array of javabean, will it work?

Solo Chiang
Greenhorn

Joined: Sep 14, 2005
Posts: 18
How do I retrive the field value of JavaBean resides in the collection of a input action form. The following is my code, it does not work! What do I miss there?

Java Bean: Item.java
public class Item {
private String a;
private String b;
public Strings getA();
public String getA();
...
}

ActionForm: ListItem.java contains multiple item
public class ListItem extends ActionForm {
Item[] items ;
public Item[] getItems() {... }
public void setItems(Item[] items) { }
}

JSP file:
<html:form action="index.do" method="post">
<td><html:text name="items[0]" property="a"/></td>
<td><html:text name="items[1]" property="a"/></td>

[ September 14, 2005: Message edited by: Solo Chiang ]
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

StrutsCatalogLazyList


A good workman is known by his tools.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Input ActionForm has a field containing an array of javabean, will it work?