Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts2 type conversion error message

Z Sugiarto
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

in Struts2 data types are automatically converted during form submission.

FOr example, in the form I can have a textfield (string) that is mapped to the attribute Age of a person object (integer).

If I input a character STruts2 will detect that this is not a number and return "INPUT". The problem is, I can not display the error message associated with this?

What I want is to be able to display "field <xxx> data type is wrong". It needs to be generic as well, I don't want to define the error message for all the fields I have in my system?

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic