Renaud,

I appreciate your response, but unfortunately when the JSP is regenerated and
displayed, Struts places the toString() value of the String array into the
<html:text property="propertyName" size="20"/> tags, such as:

    [Ljava.lang.String;@262bf4

I have also tried a twist on this strategy, with:

    private String propertyName[];
    private int propertyNameIndex;

    public void setPropertyName(String[] propertyName) {
        this.propertyName = propertyName;
        propertyNameIndex = 0;
   }

    public String getPropertyName() {  // send default value if index out of
range
        return ((propertyNameIndex < propertyName.length) ?
propertyName[propertyNameIndex++] : "");
    }

I was hoping that this strategy would allow the JSP to populate each <html:text
.../> field with successive calls to getPropertyName() but this then results in:

javax.servlet.jsp.JspException: Exception thrown by getter for property fileName
of bean org.apache.struts.taglib.html.BEAN
 at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:513)


If anybody has any other ideas on how Struts can read multiple text input
fields, all with the same name (akin to ServletRequest.getParameterValues(String
s) ), and properly populate those same fields when the JSP is displayed again, I
would greatly appreciate your thoughts!

TIA, Steve


Renaud Waldura wrote:

> Have you tried declaring your property as an array of strings?
>
> private String propertyName[];
> public String[] getPropertyName() { ... }
> public void setPropertyName(String[] propertyName) { ... }
>
> It may just work. In general I've found Struts to be amazingly flexible with
> properties and their types. Kudos to the Struts developers!
>
> --Renaud
>

--
Steven Valin
[EMAIL PROTECTED]


Reply via email to