Spring mvc 无法正确读取邮件。属性
此映像中给出了部署文件夹结构 下面给出了我的配置文件Spring mvc 无法正确读取邮件。属性,spring-mvc,Spring Mvc,此映像中给出了部署文件夹结构 下面给出了我的配置文件 <bean class="org.springframework.context.support.ReloadableResourceBundleMessageSource" id="messageSource"> <property name="basenames"> <list> <value>messages</value> </list
<bean class="org.springframework.context.support.ReloadableResourceBundleMessageSource" id="messageSource">
<property name="basenames">
<list>
<value>messages</value>
</list>
</property>
<property name="defaultEncoding" value="UTF-8" />
</bean>
信息
我的问题是当我使用标签
当我尝试访问Login.jsp时,我得到一个异常javax.servlet.ServletException:javax.servlet.jsp.jsptageException:locale“en_US”的代码下找不到任何消息
但是,当我将同一个文件(Login.jsp)放在WEB-INF\jsp文件夹中时,我没有收到任何错误,messages\u en.properties中的值将被检索并显示在网页中。谁能告诉我发生这种情况的原因并提供解决方案吗?login.jsp
(以及.properties文件)应该位于WEB-INF目录中。然后更改MessageSourcebean声明:
<bean class="org.springframework.context.support.ReloadableResourceBundleMessageSource" id="messageSource">
<property name="basenames" value="/WEB-INF/messages" />
<property name="defaultEncoding" value="UTF-8" />
</bean>
谢谢您提供的信息。当我将.jsp文件移动到WEB-INF文件夹中时,它工作正常。