If Your using Web FLow:
Declaration of the message sopurce:
Code:
<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basenames">
<value>messages</value>
</property>
</bean>
From within a flow just send the EL variable messageContext to your method ...
and the one I like:
Code:
protected MessageContext getMessageContext() {
MessageContext messageContext = (MessageContext) RequestContextHolder
.getRequestContext().getMessageContext();
return messageContext;
}
with the last one you can get you're message properties anywhere on you're code, but seems to me that is not a god idea to attach messages from within a Dao, you better throw spring exceptions, like DataAccessException, ObjectRetrievalNotFound... etc.