File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

Internationalization problem in Spring MVC integrated with tiles

Preetam Patil
Greenhorn

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"
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>
Mukhi Vla
Ranch Hand

Joined: Apr 22, 2010
Posts: 50
Do you have messages.properties 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 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.
 
subject: Internationalization problem in Spring MVC integrated with tiles
 
Similar Threads
Error creating bean with name tilesConfigurer
tiles2 - access denied page
Tiles 2.1 integration with Spring 3.0
Spring Tiles Integration
HibernateException: No Hibernate Session bound to thread