Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring mvc 无法正确读取邮件。属性_Spring Mvc - Fatal编程技术网

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文件夹中时,它工作正常。