Results 1 to 2 of 2

Thread: Howto stop "org.springframework.context.NoSuchMessageExce ptio n:"

  1. #1

    Default Howto stop "org.springframework.context.NoSuchMessageExce ptio 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. #2
    Join Date
    Oct 2008
    Location
    Poland, Wrocław
    Posts
    424

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •