开发者

jsp error message not displaying

开发者 https://www.devze.com 2022-12-19 01:05 出处:网络
on JSP when I want to display error messages but when开发者_如何学Go it returns to JSP page by

on JSP when I want to display error messages but when开发者_如何学Go it returns to JSP page by

<form:errors path="arnNumber" cssClass="error" /></span>

it is giving me an exception

org.springframework.context.NoSuchMessageException: No message found under code 'ARN number is required.contactUsUtil.arnNumber' for locale 'en_US'.


Literally translated, it just means that it cannot find any message associated with the following key

ARN number is required.contactUsUtil.arnNumber
in the message bundle as definied in the messageSource attribute of your applicationContext.xml.


The key looks suspicious :)


define it under Application context

<bean id="responseMessageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
    <property name="cacheSeconds" value="3"/>
    <property name="basename" value="classpath:response_msg" />
    <property name="defaultEncoding" value="UTF-8"/>
</bean>

define under resource folder ,it is easy

NO_SESSION=SESSION ERROR
NO_PHOTO=The photo with specified id couldn't find
SUCCESSFULL_CRATED_ALBUM=Album has created successfully
ASSIGNED_ALBUM_PHOTO=This photo assigned as your album photo.
SUCCESFULL_UPDATED_ALBUM=Album has updated successfully
SUCCESFULL_UPDATED_PHOTO=Photo has updated successfully
SUCCESFULL_CRATED_IMAGE_DIRECTORY=Image directories created successfully
0

精彩评论

暂无评论...
验证码 换一张
取 消