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 Problem in I18N in Spring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Problem in I18N in Spring" Watch "Problem in I18N in Spring" New topic
Author

Problem in I18N in Spring

vivek dhiman
Ranch Hand

Joined: Aug 05, 2011
Posts: 119

Hi

I have below code & trying to run in eclipse. It giving message resource not available. This might be an issue of mapping. Below is my code, please check.
Controller


properties file



View is :


Dispatcher Servlet


web.xml


[Thumbnail for Directory Structure.png]

Ashwini Kashyap
Ranch Hand

Joined: Aug 30, 2012
Posts: 90
You need to register beans to make support internationalization something like:

<bean id="localeResolver"
class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
<property name="defaultLocale" value="en" />
</bean>

<bean id="localeChangeInterceptor"
class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="language" />
</bean>

<bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping" >
<property name="interceptors">
<list>
<ref bean="localeChangeInterceptor" />
</list>
</property>
</bean>

Thanks,
Ashwini Kashyap | www.infocepts.com

vivek dhiman
Ranch Hand

Joined: Aug 05, 2011
Posts: 119

Hi

Thanks for reply. I changed the web.xml but getting the same error when run the application.



Below Error I am getting on console.

Ashwini Kashyap
Ranch Hand

Joined: Aug 30, 2012
Posts: 90
I think problem is that its unable to find the controller class. Try like:

<context:component-scan base-package="*.*"/> // Write your class package here

vivek dhiman
Ranch Hand

Joined: Aug 05, 2011
Posts: 119

Changes made, but still not work.

dispatcher-servlet.xml
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in I18N in Spring