• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Replace the ELException with a more meaningful description

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic