I have a spring website that worked well. I decided to add a second language so I followed this tutorial http://www.mkyong.com/spring-mvc/spring-mvc-internationalization-example/ . The language change worked well however I encountered a strange problem. Some requests were still working but for others a 404 error of mapping not found occured and this for the two languages English and French. I really didn't understand the problem especially because not all of them stopped working but only some and I didn't change the mapping. When I delete the configuration lines of internationalization they work again. Here is the code : the dispatcher servlet :
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd">
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver"
p:prefix="/WEB-INF/jsp/"
p:suffix=".jsp" />
<bean name="indexController"
class="org.springframework.web.servlet.mvc.ParameterizableViewController"
p:viewName="index" />
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename" value="messages"/>
</bean>
<bean name="/index.htm" class="metier.IndexController"/>
<bean name="/ajouterreservation.htm" class="metier.ReserverFormController">
<property name="sessionForm" value="true"/>
<property name="commandName" value="Réservation"/>
<property name="commandClass" value="modele.Réservation"/>
<property name="validator">
<bean class="metier.ReservationValidator"/>
</property>
<property name="formView" value="FormulaireAjoutReservation"/>
<property name="gestionPersonne" ref="gestionPersonne"/>
<property name="gestionChambre" ref="gestionChambre"/>
</bean>
<bean name="/jardins.htm" class="metier.JardinsController"/>
<bean name="/divertissement.htm" class="metier.ActivitésController"/>
<!-- Internationalization -->
<bean id="localeResolver"
class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
<property name="defaultLocale" value="fr" />
</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>
</beans>
The url index.htm and jardins.htm are still working however for divertissement.htm and ajouterreservation.htm I got this error : No mapping found for HTTP request with URI [/projetweb/divertissement.htm] in DispatcherServlet with name 'projetweb'