Yes, you described the scenario perfectly, and much better than I did :) This is how I understand the process as well. Using your same example, Struts will not allow that tag <html:text property="nTerminal"/> and subsequently will not process the expected method named getNTerminal(). Instead a runtime error will occur while processing the tag (this is all the information I get from the WebLogic Servlet container). For things to work, I have to rename the property as "nterminal" in the bean and update the tag as well to <html:text property="nterminal"/>. There is a problem with having a capital letter in the 2nd position of the property name.
 
Bob
-----Original Message-----
From: Craig Tataryn [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 14, 2001 10:28 AM
To: [EMAIL PROTECTED]
Subject: Re: ActionForm property naming conventions

Basically (and I might be wrong) when you subsequently try access the property, let's say with an <html:text property="nTerminal"/> tag,  Struts will do a getNTerminal() on your ActionForm.  The default is to take the property and do the following:

1) append a "get" prefix to the property
2) change the first letter of the property to uppercase
3) call that method on the form bean.

So for instance, it's prefixing your nTerminal property and mangaling it like so:

getNTerminal()

Like I said, I haven't looked at the code, but this is how I understand the process.

Craig.

[EMAIL PROTECTED] wrote:

My question is best asked with an example... Why is it that I am unable to
create a property named "nTerminal" for my ActionForm/JSP? This problem
occurs when there is an uppercase letter in the 2nd position of the property
name. If I change the name to "nterminal" or "ntErminal" then things work
just fine. In other words- getNterminal() is recognized by Struts, but
getNTerminal() is invalid and results in a runtime error in the html tag. Is
this a limitation imposed by Javabean conventions or is this a Struts
specific issue? (If you think I am crazy, then perhaps this problem is
specific to WebLogic.)

Thanks,
Bob

--
I've been trying to change the world for years, but they just won't give me the source code....
 

Reply via email to