File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in I18N in Spring

 
vivek dhiman
Ranch Hand
Posts: 152
Netbeans IDE Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Directory Structure.png
[Thumbnail for Directory Structure.png]
 
Ashwini Kashyap
Ranch Hand
Posts: 90
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 152
Netbeans IDE Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 90
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 152
Netbeans IDE Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Changes made, but still not work.

dispatcher-servlet.xml
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic