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 >
<html:form name="updateForm"
type="com.ironside.qscontentmgr.formbeans.UpdateCommitAttributeForm"
action="updateCommitAttribute">
<TABLE BORDER="0" CELLPADDING="2" CELLSPACING="1" WIDTH="80%"
ALIGN="center">
<TR>
<TD COLSPAN="2" class="header">Update Attribute - <i><%=
attr.getAttributename() %></i><br><br></TD></TR>
<TR>
<TD COLSPAN="2">Please complete the form below:</TD></TR>
<TR>
<TD><b>Attribute Name</b> <span
class="small">(required)</span><br><span class="response"><html:errors
property="attributename"/></span>
</TD>
<TD><html:text property="attribute.attributename" value="<%=
attr.getAttributename() %>"/></TD></TR>
<TR>
<TD><b>Unit of Measure</b></TD>
<TD><html:text property="attribute.unit"/></TD></TR>
<TR>
<TD><b>Refinable</b></TD>
<TD><html:radio property="attribute.refinable" value="1"/>
Yes<br><html:radio property="attribute.refinable" value="0"/> No</TD></TR>
<TR>
<TD><b>Sortable</b></TD>
<TD><html:radio property="attribute.sortable" value="1"/>
Yes<br><html:radio property="attribute.sortable" value="0"/> No</TD></TR>
<TR>
<TD><b>Visible</b></TD>
<TD><html:radio property="attribute.visible" value="1"/>
Yes<br><html:radio property="attribute.visible" value="0"/> No</TD></TR>
<TR>
<TD><b>Required</b></TD>
<TD><html:radio property="attribute.required" value="1" />
Yes<br><html:radio property="attribute.required" value="0"/> No</TD></TR>
<TR>
<TD COLSPAN="2" ALIGN="center"><html:hidden
property="attribute.categoryid" value="<%= attr.getCategoryid()
%>"/><html:hidden property="attribute.attributeid" value="<%=
attr.getAttributeid() %>"/><br><html:submit value="Update"
styleClass="varButton"/></TD></TR>
</TABLE>
</html:form>
<end form code>
Here is my action form code for this form:
<start action form code>
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);
}
}
<end action form code>
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]>