我刚开始使用Struts 1.3。我测试了Tomcat中的struts-mailreader-1.3.10.war,一切正常。然后我将.war解压缩到Eclipse的工作区中,并向根添加了一个Ant build.xml文件。当构建文件将war部署回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)
答案 0 :(得分:1)
在原始战争(struts-mailreader-1.3.10.war)中,您将在WEB-INF中拥有消息资源属性文件(资源包)。一旦ant构建了war检查,它是否将此文件复制到已部署应用程序的WEB-INF中。