我有一个运作良好的春季网站。我决定添加第二语言,所以我遵循了本教程http://www.mkyong.com/spring-mvc/spring-mvc-internationalization-example/。语言变化很好但是我遇到了一个奇怪的问题。有些请求仍然有效,但对于其他请求,发现404错误的映射未发现,这对于英语和法语这两种语言。我真的不明白这个问题,特别是因为并非所有这些都停止了工作,只有一些而且我没有改变映射。当我删除国际化的配置行时,他们再次工作。 这是代码: 调度程序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>
url index.htm和jardins.htm仍在使用divertissement.htm和ajouterreservation.htm我收到此错误: 在DispatcherServlet中找不到带有URI [/projetweb/divertissement.htm]的HTTP请求的映射,名称为'projetweb'