tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Was there an answer to this? (setProperty and repeating form fields)
Date Tue, 29 May 2001 17:52:35 GMT
I find myself in a situation similar to this, and I wondered if there was
ever an answer to the question.

In order to set my bean properties based on an incoming (POST'ed) HTML
I'm using the following construct in a JSP page:

<jsp:useBean id="ord" class="ord.OrderBean" scope="request">
  <jsp:setProperty name="ord" property="*"/>

It works fine except now I want to process something a little different.
working on an Order entry system and the Order Items are a repeating group
fields.  In my HTML form I have <input> fields named like "partNumber0,
quantity0, price0" and "partNumber1, quantity1, price1" that repeat for
potential item in an order.

Is there any way to use the <jsp:setProperty> construct to automatically
the properties in an OrderItems bean.  I'm guessing it might have something
do with indexed properties but I really can't see how this would work.  If
have my bean as

public class OrderItemBean
   String[] partNumber;

   public void setPartNumber( int index, String value ) {...}

Is the JSP runtime going to be able to take the partNumber0 field and be
to call my indexed-property setter method with the correct index.  What if
use the version

   public void setPartNumber( String[] value );

as my setter method?


NOTICE:  The information contained in this electronic mail transmission is
intended by Convergys Corporation for the use of the named individual or
entity to which it is directed and may contain information that is
privileged or otherwise confidential.  If you have received this electronic
mail transmission in error, please delete it from your system without
copying or forwarding it, and notify the sender of the error by reply email
or by telephone (collect), so that the sender's address records can be

View raw message