sps / mustache-spring-view

java spring framework mvc view for Mustache.js templates
68 stars 31 forks source link

Add support to return default message if no one was found #25

Closed ebussieres closed 6 years ago

ebussieres commented 7 years ago

Add support to not throw NoSuchMessageException when a label doesn't exist.

Possible use case

  1. Set useDefaultMessage to false (default value). Will throw NoSuchMessageException when label is not found
  2. Set useDefaultMessage to true and specify a default message for all the application
  3. Set useDefaultMessage to true and default message to null. MessageSource fallback is gonna be used in that case. Possible fallback is

messageSource.setUseCodeAsDefaultMessage(true);