This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Invalid property name?

 
Karl Beowulph
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone explain the error Invalid property name to me? I can't seem to find much description as to exactly what triggers it on the web and it's paralyzing a program I'm doing right now.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From DynaActionForm:
/**
* Return the property descriptor for the specified property name.
*
* @param name Name of the property for which to retrieve the descriptor
*
* @exception IllegalArgumentException if this is not a valid property
* name for our DynaClass
*/
protected DynaProperty getDynaProperty(String name) {

DynaProperty descriptor = getDynaClass().getDynaProperty(name);
if (descriptor == null) {
throw new IllegalArgumentException
("Invalid property name '" + name + "'");
}
return (descriptor);

}
 
Karl Beowulph
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I should clarify.

I've seen the actual coding of the error, but it still makes little sense to me.

What determines if the name is acceptabla or not?

On my current project, it will take one name, and reject others (they are not key words).
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's acceptable for use only if you've declared it.

Maybe there's a property that is being referring to (perhaps in reset()) that isn't a part of the declared form.
 
Karl Beowulph
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This was a DynaBean though, no reset method I'm aware of.

I would get that error with one name, and then, after changing the variable name in the .JSP and config.XML files, it would work.

Is there something I'm overlooking
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic