导致此错误的原因:缺少键“index.title”的消息在捆绑包“(默认捆绑包)”中对于区域设置 en_US
我刚刚开始使用 Struts 1.3。我在 Tomcat 中测试了 struts-mailreader-1.3.10.war,一切正常。然后,我将 .war 解压缩到 Eclipse 工作区中,并将 Ant build.xml 文件添加到根目录中。当构建文件将战争部署回 Tomcat 容器时,我得到下面的堆栈。由于我也是 Ant 新手,我不确定这个问题是否很可能是由于文件部署不正确引起的,或者是否有我需要添加的属性文件?我无法在我的项目中找到我在各个站点上阅读过的 MessageResources.properties,但我不确定我是否需要它,因为在我使用 eclipse 和 Ant 进行部署之前,该项目无需它即可工作。
javax.servlet.ServletException: Missing message for key "index.title" in bundle "(default bundle)" for locale en_US
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
org.apache.jsp.Welcome_jsp._jspService(Welcome_jsp.java:126)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113)
org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96)
org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
I'm just starting with Struts 1.3. I tested the struts-mailreader-1.3.10.war in Tomcat and everything works fine. I then unzipped the .war into my workspace for Eclipse and added an Ant build.xml file to the root. When the build file deploys the war back to the Tomcat container I get the stack below. Since I'm also new to Ant I'm not sure if this issue would most likely be caused by a file not deployed correctly or is there a properties file I need to add? I have not been able to find in my project the MessageResources.properties that I have read about on various sites but I'm not sure I need it since the project works without it before I deploy with eclipse and Ant.
javax.servlet.ServletException: Missing message for key "index.title" in bundle "(default bundle)" for locale en_US
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
org.apache.jsp.Welcome_jsp._jspService(Welcome_jsp.java:126)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113)
org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96)
org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在原始战争(struts-mailreader-1.3.10.war)中,您将在 WEB-INF 中拥有消息资源属性文件(资源包)。一旦 ant 构建了 war,就会检查它是否将此文件复制到已部署应用程序的 WEB-INF 中。
In the original war (struts-mailreader-1.3.10.war) you would have message resource properties file (resource bundle) in WEB-INF. Once ant builds the war check if it copies this file in the WEB-INF of the deployed application.