• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Internationalization problem in Spring MVC integrated with tiles

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to solve the problem below?


Error :-

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.util.MissingResourceException:
Can't find bundle for base name views, locale en_US

spring-servlet.xml :-


<bean id="viewResolver"
class="org.springframework.web.servlet.view.ResourceBundleViewResolver"
p:basename="views" />

<context:component-scan base-package="com.bwi.sofia.web.controller" />

<bean id="tilesConfigurer"
class="org.springframework.web.servlet.view.tiles2.TilesConfigurer"
p:definitions="/WEB-INF/tiles-defs.xml" />

<!-- Application Message Bundle -->

<bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="classpath:messages" /> <property
name="defaultEncoding" value="UTF-8" /> </bean> <bean
id="localeChangeInterceptor"
class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="lang" /> </bean> <bean
id="localeResolver"
class="org.springframework.web.servlet.i18n.CookieLocaleResolver" />

<bean id="handlerMapping"
class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
<property name="interceptors"> <ref bean="localeChangeInterceptor" />
</property> </bean>


</beans>
 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you have messages.properties file in your classpath?
 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might try being more specific in configuring the location and name of your message.properties files. Try this:



You will probably need to change the path based on where your files are located. In my case, I have a messages directory under WEB-INF where I place my message files. You'll at least need to have your messages.properties file there as well as any locale specific instances in the form of messages_[locale_code].properties (as an example: messages_de.properties for the German locale), etc.

You are getting the message below because it can't even find the default message bundle.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic