I am new using spring 3 and have been stuck for a while on this.
Do you know how can I access messages.properties from a jsp. For instance, in the controller I set a value to my model:
model.setError("user.not.found")
messages.properties:
user.not.found=Sorry, we haven't been able to found this user
and in the jsp I want to be able to do
${model.error}
and displaying "sorry...". However I always get "user.not.found" even if this works fine when I use the @Valid ..., bindingResult and then in the form.
Thanks,
Use <spring:message>
from the spring
taglib:
<spring:message code = "${model.error}" />
where taglib is imported as
<%@ taglib prefix = "spring" uri = "http://www.springframework.org/tags" %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With