This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Struts and the fly likes ognl.MethodFailedException “setCreatedDate” failed for object com.security.data.PasswordHistory@d5b5 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "ognl.MethodFailedException “setCreatedDate” failed for object com.security.data.PasswordHistory@d5b5" Watch "ognl.MethodFailedException “setCreatedDate” failed for object com.security.data.PasswordHistory@d5b5" New topic
Author

ognl.MethodFailedException “setCreatedDate” failed for object com.security.data.PasswordHistory@d5b5

Muhammad Shahid
Greenhorn

Joined: Apr 04, 2009
Posts: 1
i am using strut2.1.6 with tomcat 5.5

i have a Date field createDate in my PasswordHistory Bean, and corresponding date component on my "search.jsp" this field is optional - no validation required .

if i submit the form i am get the follwoing error on console ognl.MethodFailedException: Method "setCreatedDate" failed for object com.security.data.PasswordHistory@d5b561 [java.lang.NoSuchMethodException: setCreatedDate([Ljava.lang.String;)] –

it looks that it is trying to convert the empty string to date, when it fails it tries to search the corresponding String argument method and if it converts the value to date successfully it calls the corresponding Date argument method – Muhammad Shahid

i want to avoid any conversion if the field is emtpy.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: ognl.MethodFailedException “setCreatedDate” failed for object com.security.data.PasswordHistory@d5b5