users
[Top] [All Lists]

RE: [cinjug-users] Struts 1.0.2 problem JDK1.3 vs JDK1.4

To: ken@xxxxxxxxxxxx
Subject: RE: [cinjug-users] Struts 1.0.2 problem JDK1.3 vs JDK1.4
From: Creighton Kirkendall <ckirkendall@xxxxxxxxxxxxxx>
Date: Thu, 15 Apr 2004 17:00:18 -0400
Cc: users@xxxxxxxxxx
Delivered-to: mailing list users@cinjug.org
In-reply-to: <63340-22004441520411056@M2W099.mail2web.com>
Mailing-list: contact users-help@cinjug.org; run by ezmlm
References: <63340-22004441520411056@M2W099.mail2web.com>
Yes it does.  I think I tracked it down to a problem in the class.  The
form been has two get methods for locations one takes a integer value
for the index.  Struts uses BeanInfo to look for the names this been
info is return the properties in a different order than in jdk1.4 than
in jdk1.3.1.  Struts grabs the first getter that matches the property by
name and this happens to be the wrong one.  I hope this make some sense.

Creighton

On Thu, 2004-04-15 at 16:41, ken@xxxxxxxxxxxx wrote:
> Looks like you're using the nested properties syntax in Struts, so the
> object coming out of the locations ArrayList should also be a bean. So my
> question is, does the object coming from the ArrayList have a getter for
> active (getActive())?
> 
> Ken Poleyeff
> 
> 
> Original Message:
> -----------------
> From: Creighton Kirkendall ckirkendall@xxxxxxxxxxxxxx
> Date: Thu, 15 Apr 2004 15:37:56 -0400
> To: eric.ford@xxxxxxxxxxxxxx, users@xxxxxxxxxx
> Subject: RE: [cinjug-users] Struts 1.0.2 problem JDK1.3 vs JDK1.4
> 
> 
> Based on the struts documentation:
> http://jakarta.apache.org/struts/faqs/indexedprops.html
> 
> this is the correct way to handle indexed properties and remember it
> does work fine under 1.3 .  I should not have to cast the object because
> remember this is handled  struts tag as an interpreted language and not
> as compiled java so casting is not necessary.   Does any one know of
> issues with struts 1.0.2 and jdk 1.4 specifically with indexed
> properties.
> 
> <html:checkbox name="computersForm" property='<%= "locations["+i
> +"].active" %>' /> 
> 
> 
> 
> Creighton 
> 
> On Thu, 2004-04-15 at 15:06, Ford, Eric (LNG-DAY) wrote:
> 
> > You need to typecast after the get.
> > 
> > Like this:
> > 
> >      ((<TypeCast>)locations.get(i)).active 
> > 
> > 
> > 
> > > -----Original Message-----
> > > From: Creighton Kirkendall [mailto:ckirkendall@xxxxxxxxxxxxxx]
> > > Sent: Thursday, April 15, 2004 3:08 PM
> > > To: Jeykumar, Nattamai S. (LNG-DAY)
> > > Cc: users@xxxxxxxxxx
> > > Subject: RE: [cinjug-users] Struts 1.0.2 problem JDK1.3 vs JDK1.4
> > > 
> > > 
> > > No this wont work.  I get that their is not getter or setter 
> > > method for
> > > locations.get(i).active 
> > > Creighton
> > > 
> > > On Thu, 2004-04-15 at 14:48, Jeykumar, Nattamai S. (LNG-DAY) wrote:
> > > > Shouldn't the locations be accessed as locations.get(i) instead of
> > > > locations[i] ?
> > > > 
> > > > <html:checkbox name="computersForm" property='<%="locations.get("+ i
> > > > +").active" %>' />
> > > > 
> > > > 
> > > > Thanks,
> > > > Jey Kumar
> > > > (937)865-6800 Ext:54623
> > > > 
> > > > 
> > > > -----Original Message-----
> > > > From: Creighton Kirkendall [mailto:ckirkendall@xxxxxxxxxxxxxx]
> > > > Sent: Thursday, April 15, 2004 2:53 PM
> > > > To: Jeykumar, Nattamai S. (LNG-DAY)
> > > > Cc: users@xxxxxxxxxx
> > > > Subject: RE: [cinjug-users] Struts 1.0.2 problem JDK1.3 vs JDK1.4
> > > > 
> > > > An ArrayList
> > > > 
> > > > On Thu, 2004-04-15 at 14:41, Jeykumar, Nattamai S. (LNG-DAY) wrote:
> > > > > Is "locations" an Array or ArrayList ?
> > > > >  
> > > > >  
> > > > >  
> > > > > Thanks,
> > > > > Jey Kumar
> > > > > 
> > > > >         -----Original Message-----
> > > > >         From: Creighton Kirkendall 
> > > [mailto:ckirkendall@xxxxxxxxxxxxxx]
> > > > >         Sent: Thursday, April 15, 2004 2:36 PM
> > > > >         To: users@xxxxxxxxxx
> > > > >         Subject: [cinjug-users] Struts 1.0.2 problem 
> > > JDK1.3 vs JDK1.4
> > > > >         
> > > > >         
> > > > >         I have another weird problem for you guys.
> > > > >         
> > > > >         I am running Struts 1.0.2
> > > > >         
> > > > >         I have an action form developed outside of our 
> > > company that
> > > > >         uses an ArrayList as a property in form.  This property is
> > > > >         called locations.  They have a getter and a setter for the
> > > > >         property.  This array list has an object in it that has
> > > > >         boolean flag of active.
> > > > >         
> > > > >         In the JSP they reference this property for a 
> > > checkbox like
> > > > >         so.
> > > > >         
> > > > >         
> > > > >         <html:checkbox name="computersForm" property='<%=
> > > > >         "locations["+i +"].active" %>' /> 
> > > > >         
> > > > >         Now comes the weird part this works fine in 
> > > jdk1.3 but fails
> > > > >         under 1.4. Struts is failing on a call to
> > > > >         object.getClass().isArray().  But does not fail 
> > > on this call
> > > > >         in 1.3.  I am lost as to what the true problem is.  
> > > > >         
> > > > >         Here is the stack trace 
> > > > >         
> > > > >         
> > > > >         java.lang.IllegalArgumentException: Property 
> > > 'locations' is
> > > > >         not indexed
> > > > >                 at
> > > > >
> > > > 
> > > org.apache.struts.util.PropertyUtils.getIndexedProperty(Proper
> > > tyUtils.ja
> > > > >         va(Inlined Compiled Code))
> > > > >                 at
> > > > >
> > > > 
> > > org.apache.struts.util.PropertyUtils.getIndexedProperty(Proper
> > > tyUtils.ja
> > > > >         va(Inlined Compiled Code))
> > > > >                 at
> > > > >
> > > > 
> > > org.apache.struts.util.PropertyUtils.getNestedProperty(Propert
> > > yUtils.jav
> > > > >         a(Compiled Code))
> > > > >                 at
> > > > >
> > > > 
> > > org.apache.struts.util.BeanUtils.getNestedProperty(BeanUtils.java:297)
> > > > >                 at
> > > > >         
> > > org.apache.struts.util.BeanUtils.getProperty(BeanUtils.java:322)
> > > > >                 at
> > > > >
> > > > 
> > > org.apache.struts.taglib.html.CheckboxTag.doStartTag(CheckboxT
> > > ag.java:20
> > > > >         7)
> > > > >         
> > > > >         Note: the form is in the session scope and it 
> > > locations does
> > > > >         have a getter and a setter that return an ArrayList.
> > > > >         
> > > > >         
> > > > >         Creighton Kirkendall 
> > > 
> > > 
> > > ---------
> > > You may unsubscribe from this mailing list
> > > by sending a blank email addressed to:
> > > users-unsubscribe@xxxxxxxxxx
> > > 
> > > --
> > > Find additional help by sending a blank email
> > > addressed to:
> > > users-help@xxxxxxxxxx
> > > 
> > 
> > ---------
> > You may unsubscribe from this mailing list
> > by sending a blank email addressed to:
> > users-unsubscribe@xxxxxxxxxx
> > 
> > --
> > Find additional help by sending a blank email
> > addressed to:
> > users-help@xxxxxxxxxx
> 
> 
> --------------------------------------------------------------------
> mail2web - Check your email from the web at
> http://mail2web.com/ .
> 


<Prev in Thread] Current Thread [Next in Thread>