
Originally Posted by
Dave Syer
Make your Controller implement MessageSourceAware and use the MessageSource to access the maxNumber message.
Thanks for your help. I did try as follows:
Code:
class Sample implements MessageSourceAware {
import org.springframework.context.MessageSource;
import org.springframework.context.MessageSourceAware;
import org.springframework.context.MessageSourceResolvable;
private MessageSource messageSource;
public void setMessageSource(MessageSource messageSource) {
messageSource = messageSource;
}
public void foo(){
messageSource.getMessage(maxNumber,x,y);
}
}
What are these X and Y
I have also included bean part in my configuration file as follows.
Code:
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename"><value>messages</value></property>
</bean>
Please clarify about X(object) and Y(locale). Thanks again.