Re: nested and indexed properties in 1.0?

2000-12-18 Thread horn_ken


I sent in a patch a couple of months ago.. check the archive (?).





[EMAIL PROTECTED] on 15/12/2000 19:39:21

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:(bcc: Ken X Horn)
Subject:  Re: nested and indexed properties in 1.0?



Matthias Kerkhoff wrote:

> > Is 1.0 going to have full support for nested and indexed properties?  I
have y forms which use property names such as "apples[2].oranges[3]" and I
would
> > really appreciate it if this was supported in 1.0.  It's a simple
change to
> > support this since PropertyUtils already does it.  All that needs to be
done
>
> Its indeed a simple change. I'm also running a modified version of struts
> capable to use nested and indexed properties. I would too like this
feature
> to be incorparated into struts.

Is anyone who has implemented this modification willing to share?  I need
this feature yesterday, and am hoping I don't have to wait until Struts 1.0
final
or (gasp) Struts 1.1.

Thanks in advance,

Jim Newsham










Re: nested and indexed properties in 1.0?

2000-12-15 Thread Eric

I had attached an old modified version of mine to a message to
struts-user (or maybe struts-dev) a while ago.  Here is an updated
version in which I've integrated my changes into the latest CVS
version of BeanUtils.java.  I haven't tested this version, and I'm not
sure it works with multipart requests (file uploads) correctly, so
don't count on it too much without taking a look at it...it is,
however, an example of how population with nested and indexed
properties can be supported (in a dirty hack kind of way).

eric.

On Fri, Dec 15, 2000 at 02:39:21PM -1000, Jim Newsham wrote:
> Matthias Kerkhoff wrote:
> 
> > > Is 1.0 going to have full support for nested and indexed properties?  I have y 
>forms which use property names such as "apples[2].oranges[3]" and I would
> > > really appreciate it if this was supported in 1.0.  It's a simple change to
> > > support this since PropertyUtils already does it.  All that needs to be done
> >
> > Its indeed a simple change. I'm also running a modified version of struts
> > capable to use nested and indexed properties. I would too like this feature
> > to be incorparated into struts.
> 
> Is anyone who has implemented this modification willing to share?  I need this 
>feature yesterday, and am hoping I don't have to wait until Struts 1.0 final
> or (gasp) Struts 1.1.
> 
> Thanks in advance,
> 
> Jim Newsham
> 

-- 
 _  _ 
| |(_) http://www.iit.edu/~jenseri
|  _|  | | Page me via ICQ at
| |___ | | http://wwp.mirabilis.com/19022931
|__/ | or by mailing [EMAIL PROTECTED]
 |__/


/*
 * $Header: 
/home/cvspublic/jakarta-struts/src/share/org/apache/struts/util/BeanUtils.java,v 1.15 
2000/11/13 17:31:05 mschachter Exp $
 * $Revision: 1.15 $
 * $Date: 2000/11/13 17:31:05 $
 *
 * 
 *
 * The Apache Software License, Version 1.1
 *
 * Copyright (c) 1999 The Apache Software Foundation.  All rights
 * reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *notice, this list of conditions and the following disclaimer in
 *the documentation and/or other materials provided with the
 *distribution.
 *
 * 3. The end-user documentation included with the redistribution, if
 *any, must include the following acknowlegement:
 *   "This product includes software developed by the
 *Apache Software Foundation (http://www.apache.org/)."
 *Alternately, this acknowlegement may appear in the software itself,
 *if and wherever such third-party acknowlegements normally appear.
 *
 * 4. The names "The Jakarta Project", "Tomcat", and "Apache Software
 *Foundation" must not be used to endorse or promote products derived
 *from this software without prior written permission. For written
 *permission, please contact [EMAIL PROTECTED]
 *
 * 5. Products derived from this software may not be called "Apache"
 *nor may "Apache" appear in their names without prior written
 *permission of the Apache Group.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * 
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the Apache Software Foundation.  For more
 * information on the Apache Software Foundation, please see
 * .
 *
 */


package org.apache.struts.util;


import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Array;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Vector;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.PageContext;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionS

Re: nested and indexed properties in 1.0?

2000-12-15 Thread Jim Newsham

Matthias Kerkhoff wrote:

> > Is 1.0 going to have full support for nested and indexed properties?  I have y 
>forms which use property names such as "apples[2].oranges[3]" and I would
> > really appreciate it if this was supported in 1.0.  It's a simple change to
> > support this since PropertyUtils already does it.  All that needs to be done
>
> Its indeed a simple change. I'm also running a modified version of struts
> capable to use nested and indexed properties. I would too like this feature
> to be incorparated into struts.

Is anyone who has implemented this modification willing to share?  I need this feature 
yesterday, and am hoping I don't have to wait until Struts 1.0 final
or (gasp) Struts 1.1.

Thanks in advance,

Jim Newsham




Re: nested and indexed properties in 1.0?

2000-12-15 Thread Matthias Kerkhoff

> Is 1.0 going to have full support for nested and indexed properties?  I have y forms 
>which use property names such as "apples[2].oranges[3]" and I would
> really appreciate it if this was supported in 1.0.  It's a simple change to 
> support this since PropertyUtils already does it.  All that needs to be done 

Its indeed a simple change. I'm also running a modified version of struts
capable to use nested and indexed properties. I would too like this feature
to be incorparated into struts.

> is to make BeanUtils.populate use PropertyUtils.setProperty (with maybe some 
> hacking around to make PropertyUtils support type conversion, but all the code 
> for that is already in BeanUtils).  If you're going to support getting complex 
> properties like this (and setting them, with PropertyUtils), why not support 
> full bean population with them?

> Also, will 1.0 support some way to use JSP variables in property names?  For 
> example, I have JSP pages with present the user a table full of form input boxes
> and I want to generate it simple with a for loop in a scriptlet.  However, I 
> couldn't do this before because you can't have 
> 

Use . This is not a
struts thing, it's the JSP spec that leads to this syntax.

> Is there a way around this now?  Will there be with 1.0?

See above.

-- 
Matthias(mailto:[EMAIL PROTECTED])





nested and indexed properties in 1.0?

2000-12-15 Thread ej

Is 1.0 going to have full support for nested and indexed properties?  I have y forms 
which use property names such as "apples[2].oranges[3]" and I would 
really appreciate it if this was supported in 1.0.  It's a simple change to 
support this since PropertyUtils already does it.  All that needs to be done 
is to make BeanUtils.populate use PropertyUtils.setProperty (with maybe some 
hacking around to make PropertyUtils support type conversion, but all the code 
for that is already in BeanUtils).  If you're going to support getting complex 
properties like this (and setting them, with PropertyUtils), why not support 
full bean population with them?

Also, will 1.0 support some way to use JSP variables in property names?  For 
example, I have JSP pages with present the user a table full of form input boxes
and I want to generate it simple with a for loop in a scriptlet.  However, I 
couldn't do this before because you can't have 

Is there a way around this now?  Will there be with 1.0?

Thanks,
eric.