Code:<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> <property name="basename"><value>messages</value></property> </bean>
messages.propertiesCode:<jsp:useBean id="now" class="java.util.Date" /> <fmt:message key="nowkey"> <fmt:param value="${now}" /> </fmt:message>
nowkey = hello {0, date, yyyyMM}
and the result always be "hello 10/11/04 10:24 AM "
modify the messages.properties file
nowkey = hello222 {0, date, yyyyMM}
and the result will be "hello222 10/11/04 10:24 AM "
if I setBundle in jstl, the result is correct !
it be "hello222 200410"
how to resolve this problem?Code:<fmt:bundle basename="messages"> <fmt:message key="nowkey"> <fmt:param value="${now}"> </fmt:param> </fmt:message> </fmt:bundle>
could I solve this problem without explicitly specify the bundle in every
jsp file?


Reply With Quote