RE: Question: error "No getter method for property..."

2002-04-18 Thread Stott, David

Sorry, I sent the wrong action form code - it should look like:

package com.ironside.qscontentmgr.formbeans;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

import com.ironside.qscontentmgr.jdbc.CategoryAttribute;

public final class UpdateCommitAttributeForm extends ActionForm 
{

// --- Instance
Variables
private CategoryAttribute attribute = new CategoryAttribute();

// ---
Properties

 public void setAttribute(CategoryAttribute attribute) { this.attribute
= attribute; }
 public CategoryAttribute getAttribute() { return this.attribute; }
 
// - Public
Methods

/**
 * Reset all properties to their default values.
 *
 * @param mapping The mapping used to select this instance
 * @param request The servlet request we are processing
 */
public void reset(ActionMapping mapping, HttpServletRequest request) {

this.attribute = new CategoryAttribute();
}



   public ActionErrors validate(ActionMapping mapping,
 HttpServletRequest request) {

ActionErrors errors = new ActionErrors();

if ((attribute.getAttributename() == null) ||
(attribute.getAttributename().length() < 1))
errors.add("attributename",
   new ActionError("error.category.categoryname"));
return (errors);

}
}

-Original Message-
From: Stott, David [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 18, 2002 2:13 PM
To: '[EMAIL PROTECTED]'
Subject: FW: Question: error "No getter method for property..."


Hi List,

I checked the archives on this one thoroughly, and though it has been
discussed, nothing was definitive and didn't seem to address my situation.

I'm getting the following exception:
"javax.servlet.ServletException: No getter method for property
attribute.unit of bean org.apache.struts.taglib.html.BEAN"

when using a nested bean in a form.  Strangely, I can't consistently
replicate the error as it seems to come and go.  Here is my form code:

< start form code >





Update Attribute - <%=
attr.getAttributename() %>

Please complete the form below:

Attribute Name (required)



Unit of Measure


Refinable

Yes No

Sortable

Yes No

Visible

Yes No

Required

Yes No









Here is my action form code for this form:



public final class UpdateCommitCategoryForm extends ActionForm  {

// --- Instance
Variables
private Category category = new Category();
private CategoryNav catnav = new CategoryNav();
private String[] parents = null;

// ---
Properties

public void setCategory(Category category) { this.category =
category; }
public Category getCategory() { return this.category; }
public void setCatnav(CategoryNav catnav){ this.catnav = catnav; }
public CategoryNav getCatnav() { return this.catnav; }
// - Public
Methods

public void reset(ActionMapping mapping, HttpServletRequest request)
{

this.category = new Category();
}

public ActionErrors validate(ActionMapping mapping,
 HttpServletRequest request) {

ActionErrors errors = new ActionErrors();

if ((category.getCategoryname() == null) ||
(category.getCategoryname().length() < 1))
errors.add("categoryname",
   new ActionError("error.category.categoryname"));
return (errors);

}
}




And lastly, I do have get and set methods in my Attribute class for each
property:

...

public String getUnit(){ return (this.unit); }
public void setUnit(String unit){ this.unit = unit; }

...

Anyone have any ideas?

Much thanks in advance,

David Stott
Technical Solutions Analyst
Ironside Technologies Inc.
600 Alden Road. 7th Floor
Markham, Ontario L3R 0E7
[p] 905.415.3900 ext.3363
[f] 905.415.3901 
[EMAIL PROTECTED] 

Connecting Suppliers With Buyers

--
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]>




FW: Question: error "No getter method for property..."

2002-04-18 Thread Stott, David

Hi List,

I checked the archives on this one thoroughly, and though it has been
discussed, nothing was definitive and didn't seem to address my situation.

I'm getting the following exception:
"javax.servlet.ServletException: No getter method for property
attribute.unit of bean org.apache.struts.taglib.html.BEAN"

when using a nested bean in a form.  Strangely, I can't consistently
replicate the error as it seems to come and go.  Here is my form code:

< start form code >





Update Attribute - <%=
attr.getAttributename() %>

Please complete the form below:

Attribute Name (required)



Unit of Measure


Refinable

Yes No

Sortable

Yes No

Visible

Yes No

Required

Yes No









Here is my action form code for this form:



public final class UpdateCommitCategoryForm extends ActionForm  {

// --- Instance
Variables
private Category category = new Category();
private CategoryNav catnav = new CategoryNav();
private String[] parents = null;

// ---
Properties

public void setCategory(Category category) { this.category =
category; }
public Category getCategory() { return this.category; }
public void setCatnav(CategoryNav catnav){ this.catnav = catnav; }
public CategoryNav getCatnav() { return this.catnav; }
// - Public
Methods

public void reset(ActionMapping mapping, HttpServletRequest request)
{

this.category = new Category();
}

public ActionErrors validate(ActionMapping mapping,
 HttpServletRequest request) {

ActionErrors errors = new ActionErrors();

if ((category.getCategoryname() == null) ||
(category.getCategoryname().length() < 1))
errors.add("categoryname",
   new ActionError("error.category.categoryname"));
return (errors);

}
}




And lastly, I do have get and set methods in my Attribute class for each
property:

...

public String getUnit(){ return (this.unit); }
public void setUnit(String unit){ this.unit = unit; }

...

Anyone have any ideas?

Much thanks in advance,

David Stott
Technical Solutions Analyst
Ironside Technologies Inc.
600 Alden Road. 7th Floor
Markham, Ontario L3R 0E7
[p] 905.415.3900 ext.3363
[f] 905.415.3901 
[EMAIL PROTECTED] 

Connecting Suppliers With Buyers

--
To unsubscribe, e-mail:   
For additional commands, e-mail: