cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Form annotations are not working after upgrade

Former Member
0 Likes
473

Hi Experts,

In the ForgottenPwdForm, there are few annotations which are not working after upgrade, spring message resolver not able to resolve the message key and I am seeing {forgottenPwd.email.invalid} as message, if I submit the form with invalid email.

 private String email;
 
     /**
      * @return the email
      */
     @NotNull(message = "{forgottenPwd.email.invalid}")
     @Size(min = 1, max = 255, message = "{forgottenPwd.email.invalid}")
     @Email(message = "{forgottenPwd.email.invalid}")
     public String getEmail()
     {
         return email;
     }

I suspect that some of the bean in strofront/../spring-mvc-config.xml are not being loaded in proper manner. my setting for the message resolver in sping file as follows:

 <!-- Localization -->
     <bean id="validator" class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean" >
         <property name="validationMessageSource" ref="storefrontMessageSource"/>
     </bean>
 
     <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource" >
         <property name="basenames">
             <list>
                 <value>/WEB-INF/messages/base</value>
             </list>
         </property>
         <property name="defaultEncoding" value="UTF-8"/>
         <!-- The number of seconds to cache loaded properties files. Set to -1 (never) for production. -->
         <property name="cacheSeconds" value="#{configurationService.configuration.getProperty('storefront.resourceBundle.cacheSeconds')}"/>
         <property name="fallbackToSystemLocale" value="false"/>
     </bean>
 
     <!-- theme message source - falls back to the messageSource -->
     <alias name="storefrontMessageSource" alias="themeSource" />
     <bean id="storefrontMessageSource" class="com.celio.ecelio.storefront.web.theme.StorefrontResourceBundleSource">
         <property name="basenamePrefix" value="/WEB-INF/messages/" />
         <property name="basePrefix" value="base" />
         <property name="sitePrefix" value="site" />
         <property name="themePrefix" value="theme" />
         <property name="parentMessageSource" ref="messageSource" />
         <property name="requiredAddOnsNameProvider" ref="reqAddOnsNameProvider" />
         <!-- The number of seconds to cache loaded properties files. Set to -1 (never) for production. -->
         <property name="cacheSeconds" value="#{configurationService.configuration.getProperty('storefront.resourceBundle.cacheSeconds')}"/>
         <property name="defaultEncoding" value="UTF-8"/>
         <property name="fallbackToSystemLocale" value="false" />
         <property name="resourceLoader">
             <bean class="org.springframework.core.io.FileSystemResourceLoader"/>
         </property>
     </bean>

Would appreciate your help!!

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Likes

Hi devendra,

I'm facing the same issue.

Have you fixed it?

Former Member
0 Likes

Hi devendra,

have u fixed the above issue?