It's not a secret anymore!
The moose likes Spring and the fly likes Internationalization problem in Spring MVC integrated with tiles Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Internationalization problem in Spring MVC integrated with tiles" Watch "Internationalization problem in Spring MVC integrated with tiles" New topic

Internationalization problem in Spring MVC integrated with tiles

Preetam Patil

Joined: Jul 29, 2010
Posts: 1
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"
p:basename="views" />

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

<bean id="tilesConfigurer"
p:definitions="/WEB-INF/tiles-defs.xml" />

<!-- Application Message Bundle -->

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

<bean id="handlerMapping"
<property name="interceptors"> <ref bean="localeChangeInterceptor" />
</property> </bean>

Mukhi Vla
Ranch Hand

Joined: Apr 22, 2010
Posts: 53
Do you have file in your classpath?
Mark Secrist
Ranch Hand

Joined: Jul 01, 2003
Posts: 89
You might try being more specific in configuring the location and name of your 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 file there as well as any locale specific instances in the form of messages_[locale_code].properties (as an example: for the German locale), etc.

You are getting the message below because it can't even find the default message bundle.
I agree. Here's the link:
subject: Internationalization problem in Spring MVC integrated with tiles
It's not a secret anymore!