Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Muhammad Shahid
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic