DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36794>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36794





------- Additional Comments From [EMAIL PROTECTED]  2005-11-15 04:23 -------
Created an attachment (id=16969)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=16969&action=view)
Example DynaBeanInterceptor class

> Actually, I'm not sure if JSTL is relying on the plain getStringArray(void) /

> getStringMap(void) methods in these cases; I'll check whether the interceptor

> ever sees extra args and perhaps can simplify here.

I think both the mapped and indexed properties are being accessed by JSTL using
the normal getter/setter. In the case of "mapped" properties - JSTL doesn't
know anything about them - thats a BeanUtils concept, not a java one in
general. For indexed properties, you haven't created "indexed methods" in your
interface - so it can't be using the indexed getter/setter.

I don't agree about the simplicity - its not that complex not using reflection
and it saves creating/copying new copies of the Class[] and Object[] for the
arguments.

Attaching a sample DynaBeanInterceptor, based on your code. To use this in
DynaActionFormClass would need to do something like the following...

In the DynaActionFormClass constructor...

    private Enhancer enhancer;
    public DynaActionFormClass(FormBeanConfig config) {
        introspect(config);
        if (config.is?????()) {
             DynaBeanInterceptor interceptor = new DynaBeanInterceptor();
             enhancer = interceptor.createEnhancer(this, getBeanClass());
        }

    }

... and then in the newInstance() method...

   public DynaBean newInstance() {
       DyanActionForm dynaBean = null;
       if (enhancer != null) {
           dynaBean = (DynaActionForm)enhancer.create();
       } else {
           dynaBean = (DynaActionForm)getBeanClass().newInstance();
       }
       dynaBean.setDynaActionFormClass(this);
       FormPropertyConfig[] props = config.findFormPropertyConfigs();
       for (int i = 0; i < props.length; i++) {
           dynaBean.set(props[i].getName(), props[i].initial());
       }
   }


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to