• Post Reply Bookmark Topic Watch Topic
  • New Topic

Struts2 type conversion error message  RSS feed

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?

Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!