我曾在春季3 mvc.I配置本地化和内在放在属性文件中的资源folder.And其工作properly.Now我想使用JavaScript内根据语言提供适当的警报消息。 下面的属性文件我的项目结构,给出
Project
|
|
src
resource
|_message.properties
|_message_en.properties
|_message_es.properties
我想使用jQuery internalization.Now我要访问使用jQuery.I这些属性文件在JavaScript中写下面的代码加载我的属性文件
jQuery.i18n.properties({
name:'message',
path:'resources/',
mode:'both',
language:'en'
});
**But I am getting Http 404 Error during loading of the page.**
**GET http://SERVER IP:PORT/viuw/resources/message.properties?_=1373877147985 404 (Not Found)**
How to load Property files using jQuery.i18n.property.js?
my configuration is
<bean id="localeResolver"
class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
<property name="defaultLocale" value="es" />
</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>
<bean id="messageSource"
class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename" value="message" />
</bean>
web.xml file configuration is
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>*.html</url-pattern>
<url-pattern>/</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>