You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Swaminathan Gurumoorthy <sw...@yahoo.com> on 2003/07/11 21:37:14 UTC
Newbie: Using "property" attribute in bean:write
I have a value object which has a invoice date (String). I have two getMethods in my value object
private String invoiceDate;
public String getInvoiceDate() {
return invoiceDate;
}
public String getDisplayInvoiceDate() {
return DateUtils.formatDate(invoiceDate);
}
Note that my getDisplayInvoiceDate is just a helper method to format bean property "invoiceDate"
Now in my jsp, if I want to display the formatted invoicedate like this
<td><bean:write name="detail" property="displayInvoiceDate" /></td>
I wud think Struts just call getDisplayInvoiceDate() on the bean and display the value.
On the contrary, I get an error
javax.servlet.ServletException: Exception thrown by getter for property displayInvoiceDate of bean detail
Does this mean, Stuts expects a property "displayInvoiceDate " in my bean?
How do I overcome this?
Thanks
Swami
---------------------------------
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!