Hi, I try to use the LocaleBeanUtils for coping a valueobject with java.sql.Date member to a form object with String representation of date in "mm/dd/yyyy" format. (using common-beanutils 1.5 and struts 1.1b3)
How can I set the pattern "MM/dd/yyyy" for DateLocalConverter? Here is my code in action object that do the conversion: Action class: ------------- ... import org.apache.commons.beanutils.locale.LocaleBeanUtils; import java.util.Locale; ... //if I set local here, it will cause error //LocaleBeanUtils.setDefaultLocale(Locale.US); LocaleBeanUtils.copyProperties(myForm, myValueObj); ... In myValueObj, there is java.sql.Date member: --------------- ... java.sql.Date orderDate; public java.sql.Date getOrderDate() { return orderDate; } public void setOrderDate(java.sql.Date orderDate) { this.orderDate = orderDate; } ... In myForm there is a String for orderDate: ----------- ... String orderDate; public String getOrderDate() { return orderDate; } public void setOrderDate(String orderDate) { this.orderDate = orderDate } ... And myValueObj will has data from database, then it should copy to myForm where the orderDate should be like "MM/dd/yyyy". But currently it just convert to default date format in "yyyy-mm-dd". Any idea? Thanks. David __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>