实际上,我创建了两个文件(MessageBundle_fr_BE 和 MessageBundle_us_US),我在其中放置了不同的文本来翻译以使我的应用程序国际化
我的问题是当我启动应用程序时,出现以下错误:
Problem accessing /MyServlet. Reason:
Can't find bundle for base name MessageBundle, locale fr_FR
Caused by:
java.util.MissingResourceException: Can't find bundle for base name MessageBundle, locale fr_FR
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1499)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1322)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:796)
at com.application.myGoogleAppEngine.Internationale.<init>(Internationale.java:13)
at com.application.myGoogleAppEngine.Internationale.getInstance(Internationale.java:18)
at com.application.myGoogleAppEngine.MyServlet.doPost(MyServlet.java:52)
at com.application.myGoogleAppEngine.MyServlet.doGet(MyServlet.java:30)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
项目结构如下:
- src
- main
- webapp
- images
- js
- stylesheets
- resources
MessageBundle_fr_FR.properties
MessageBundle_us_US.properties
- WEB-INF
- appengine-web.xml
- logging.properties
- web.xml
- index.jsp
- java
- com.application.myGoogleApp
- test
- target
- pom.xml
- nbActions.xml
- README.md
我的 pom.xml 的一部分包括 'src/main/webapp/resources' 目录:
<configuration>
<archiveClasses>true</archiveClasses>
<webResources>
<!-- in order to interpolate version from pom into appengine-web.xml -->
<resource>
<directory>${basedir}/src/main/webapp/WEB-INF</directory>
<filtering>true</filtering>
<targetPath>WEB-INF</targetPath>
</resource>
<resource>
<directory>${basedir}/src/main/webapp/resources</directory>
</resource>
</webResources>
</configuration>
你能帮助我吗 ?
谢谢