Arrrghh!  As you may suspect, I was doing something foolish:  I was looking
at the wrong form.  I didn't realize that, when matching up the properties
of input fields set by <html> custom tags in an <html:form>, you need to
match the fields against properties in the form associated with the action
mapping which is the DESTINATION of the form, not in the form associated
with the action mapping FROM WHICH CONTROL arrived at the form.  Because of
this, my fields didn't match my properties, and none would've been found by
the Struts custom tags. 

This fact was somewhat concealed from me by a "false positive" from Struts:
if in the <html:text> tag the 'value' attribute is set, *apparently* the tag
doesn't check for a getter/setter pair that corresponds to the 'property'
attribute.  So, the page rendered fine until it got to the <html:radio> tag,
which *apparently* DOES check for a getter/setter pair EVEN IF you supply a
'value' attribute.  I spent too much time wondering my <html:radio> wasn't
working and not enough time realizing that none of my tags were actually
working.

I'm sure most people would never have this problem, but to any who might, I
hope this servers as a cautionary tale.

Cheers,
David

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] 
Sent: Thursday, April 25, 2002 2:06 PM
To: [EMAIL PROTECTED]
Subject: RE: Struts reflection can't find getters on form bean

That helps some, Tim, thanks.  In the case of my <html:radio> tags I always
knew my getter/setters weren't being found or called.  This indicates that
perhaps the getters/setters aren't being called on my <html:text> tags
either, but that this fact is concealed because Struts silently uses the
"value" attribute on that tag.  Perhaps it doesn't do this for <html:radio>
tags.

Of course, I still have to figure out why my getters/setters aren't being
found/called, but at least I see I have one problem and not two.

*sigh* And I wish it were so simple:
I have getUsDollarEquivalent and setUsDollarEquivalent, and my "property" is
set to "usDollarEquivalent".  

-D

-----Original Message-----
From: Pedone, Tim [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, April 25, 2002 1:52 PM
To: 'Struts Users Mailing List'
Subject: RE: Struts reflection can't find getters on form bean

Are you sure that the getter/setter is getting called for your
usDollarEquivalent attribute.  If Struts can't find the getter, it just
silently uses the "value" from the value tag.  This is probably a case
issue.  If your getter is getUSDollarEquivalent() then your property should
be USDollarEquivalent not usDollarEquivalent.  Based on your property,
Struts is expecting getUsDollarEquivalent().

Tim

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 25, 2002 12:31 PM
To: [EMAIL PROTECTED]
Subject: RE: Struts reflection can't find getters on form bean


To add insult to injury, on this same form I have a <html:text> tag which
fails to find its property unless I supply the "value" attribute, as in
<html:text property="usDollarEquivalent" value=""/>.  What the heck is going
on here?  Is "value" a required attribute?  And why would it have anything
to do with whether or not the Tag can find the property?

Yours in aggravation,
Dave

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] 
Sent: Thursday, April 25, 2002 11:59 AM
To: [EMAIL PROTECTED]
Subject: Struts reflection can't find getters on form bean

Hello,

 

I'm having the weirdest problem with Struts.  When rendering a JSP using the
<html:> custom tags, Struts can't find some of the getters on the form bean.
In particular, it's when using <html:radio>.  In my form bean
wireTransferForm, which corresponds to the Java class WireTransferForm, I
have properties transferType and routingType, both of which are Strings.  If
I access these in the <html:form> using <html:text>, no problem.  If I
access them using <html:radio>, I get the error:

javax.servlet.jsp.JspException: No getter method for property routingCode of
bean org.apache.struts.taglib.html.BEAN.

 

What is going on here?  Why would I be able to access a property with
<html:text> and not with <html:radio>?  

 

Thanks!

David

 

David A. Ventimiglia

Wells Fargo Private Client Services

(415) 396-0414 (work)

 


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



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

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

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

Reply via email to