The issue isn't that the field name is 'close to' the class name; in
fact the field name is irrelevant. It's the name of the getter/setter
methods that matters. The JavaBeans specification defines the rules for
mapping between property names and getter/setter method names. The main
thing to remember is that the rules include special cases for when the
property name doesn't follow the usual [a-z]{2,}.* pattern.
L.
Gupta, Karan wrote:
Thansk for your reply Rick.
You're right, I have seen that when field names are very close to the class
name then this problem does occur.
But why?
Does reflection not work when only one character is changed?
Thanks,
Karan
-----Original Message-----
From: Rick R [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 12, 2006 5:34 PM
To: Struts Users Mailing List
Subject: Re: How to use a POJO inside Struts FormBean?
Gupta, Karan wrote:
/**** CLASS IDefForm ***/
public class IDefForm extends ActionForm
{
private IDef iDef;
Did you try renaming the property like Hubert suggested? If not, that
iDef will DEFINITELY cause the problem that you mention. Change private
IDef iDef; to something like IDef invDef with appropriate getters and
setters.
Also, you don't really need to use the nested tag for that shallow of
nesting (one deep) since using invDef.partNumber etc should work just
fine. (I do have a short demo app on using the nested tag if you want to
go that route though http://www.learntechnology.net/struts-nested.do ).
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]