Java Spring security internazionalization消息未被覆盖
嗨,我试图覆盖spring security的英文默认消息,但我有一些特定消息没有得到覆盖消息,这些是我的代码Java Spring security internazionalization消息未被覆盖,java,spring,spring-mvc,spring-security,Java,Spring,Spring Mvc,Spring Security,嗨,我试图覆盖spring security的英文默认消息,但我有一些特定消息没有得到覆盖消息,这些是我的代码 <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> <property name="basename" value="classpath:messages/messages" /> &
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="classpath:messages/messages" />
<property name="defaultEncoding" value="UTF-8" />
</bean>
<bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="lang" />
</bean>
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
<property name="defaultLocale" value="es_MX"/>
<property name="cookieName" value="gb"/>
<property name="cookieMaxAge" value="4800"/>
</bean>
<bean id="handlerMapping" class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
<property name="interceptors">
<ref bean="localeChangeInterceptor" />
</property>
</bean>
jsp中显示的消息是:
通常情况下,不正确的合同条款
但对于这一点:
ConcurrentSessionControlStrategy.exceededAllowed=Esta cuenta ya esta siendo utilizada
我收到这个信息:
已超过此主体的最大会话数1
消息在jsp中的打印方式如下:
<c:if test="${not empty param.login_error}">
<p class="text-danger text-center"><strong>${sessionScope.SPRING_SECURITY_LAST_EXCEPTION.localizedMessage}</strong></p>
</c:if>
${sessionScope.SPRING\u SECURITY\u LAST\u EXCEPTION.localizedMessage}
正如您所看到的,消息在我的自定义消息中被正确翻译,但在应用程序中不正确,有人可以帮助我
我正在使用下一个库
- 弹簧4.1.6.1释放
- 弹簧安全3.2.7.1释放
- ApacheTiles 3.0.5
提前感谢。似乎消息键在Spring中已更改,但在中未更改。您得到英文消息的原因是,在我链接到的Java代码中提供了默认消息 尝试: 它应该会起作用 编辑:
甚至有一个问题是在上创建的。似乎消息键在Spring中已更改,但在中未更改。您得到英文消息的原因是,在我链接到的Java代码中提供了默认消息 尝试: 它应该会起作用 编辑: 甚至还为此创建了一个问题
<c:if test="${not empty param.login_error}">
<p class="text-danger text-center"><strong>${sessionScope.SPRING_SECURITY_LAST_EXCEPTION.localizedMessage}</strong></p>
</c:if>
ConcurrentSessionControlAuthenticationStrategy.exceededAllowed=Esta cuenta ya esta siendo utilizada