You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Da...@WellsFargo.COM on 2002/04/25 20:58:52 UTC

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)

 


Re: Struts reflection can't find getters on form bean

Posted by Edward Muller <em...@learningpatterns.com>.
Your WireTransferForm bean should look something like...

import org.apache.struts.action.ActionForm;

public WireTransferForm extends ActionForm
{

	private String routingCode = "";

	public String getRoutingCode()
	{
		return this.routingCode;
	}

	public void setRoutingCode(String newRoutingCode)
	{
		this.routingCode = newRoutingCode;
	}

}

i.e. you need a getter and setter for each property ...

On Thu, 2002-04-25 at 14:58, David.A.Ventimiglia@WellsFargo.COM wrote:
> 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)
> 
>  
> 
-- 
--------------------------------------------------
Edward Muller - Director of Information Services
LearningPatterns.com Inc.

Mobile: 973.715.0230
   NYC: 212.487.9064 x115

Email/Jabber: emuller@learningpatterns.com

http://www.learningpatterns.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>