Announcement Announcement Module
Collapse
No announcement yet.
Howto stop "org.springframework.context.NoSuchMessageExceptio n:" Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Howto stop "org.springframework.context.NoSuchMessageExceptio n:"

    Hi everyone,

    I'm writing a webapp (but I suppose that my problem can also be usefull in other apps) who use MessageSources.
    But when the MessageSource (org.springframework.context.support.ResourceBundle MessageSource in this case) throw an org.springframework.context.NoSuchMessageException when a key isn't found.
    Is it a way to return a default message like "??"+key+"??" instead of thowing an exception ?

    Of course, I can override the MessageSource but If Spring has already a solution that's better.

    Thanks

  • #2
    Hi

    See: org.springframework.context.support.AbstractMessag eSource.setUseCodeAsDefaultMessage(boolean)

    As - that won't give you "??<code>??", but it's better than exception

    regards
    Grzegorz Grzybek

    Comment

    Working...
    X