• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Replace the ELException with a more meaningful description

 
Lyndon Tate
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anybody know if it is possible to replace the ELException with a more meaningful description?

Background Info: I have a text field which accepts input and validation stops users entering a certain length. If this is accepted further checking occurs during the binding of the entered data to the data model. At this point an exception is thrown providing a description of the problem. However JSF always reports an ElException:

javax.faces.el.EvaluationException: javax.el.ELException: Error writing 'amountScreen' on type com.essentis.datamodel.ejm.MainFee

Is there anyway of replacing this error message with a more meaninfull error message? Is there something similiar to JSF converter messages. Like the one for INTEGER?
javax.faces.converter.IntegerConverter.INTEGER=Must be a numeric consisting of one or more digits.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17646
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, Lyndon!

Normally you'd get that error when the property referred to in the EL isn't defined in accessible way. For example, if the setter/getter has an improper signature, such as not being defined as "public". Alternatively, it could indicate that the backing object cannot directly handle the conversion to/from a display string (in which case you probably need to define a property whose mutators can do the required translations).

You shouldn't get ELExceptions for invalid data, only for actual programming errors. So there shouldn't be a need to override the message. I'm fairly sure you can override the message, as far as it goes, but like I said, it's a symptom of a bigger problem, so I wouldn't bother.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic