我有一个 jsp 文件 Trainer.jsp,其中有一个代码
$<f:loadBundle basename="kk.saken.jsf.starter.messages" var="msg" />
问题是“在类路径上找不到资源包 jsf.starter.messages”
当我运行 Trainer.jsp 时,它显示:
类型异常报告
信息
描述 服务器遇到一个内部错误 () 阻止它完成这个请求。
例外
org.apache.jasper.JasperException: java.util.MissingResourceException: Can't find bundle for base name kk.saken.jsf.starter.messages, locale en_US
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:413)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:546)
com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:364)
com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:154)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
root cause
java.util.MissingResourceException: Can't find bundle for base name kk.saken.jsf.starter.messages, locale en_US
java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1499)
java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1322)
java.util.ResourceBundle.getBundle(ResourceBundle.java:1028)
com.sun.faces.taglib.jsf_core.LoadBundleTag.doStartTag(LoadBundleTag.java:164)
org.apache.jsp.Trainer_jsp._jspx_meth_f_005floadBundle_005f0(Trainer_jsp.java:179)
org.apache.jsp.Trainer_jsp._jspx_meth_f_005fview_005f0(Trainer_jsp.java:135)
org.apache.jsp.Trainer_jsp._jspService(Trainer_jsp.java:98)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253)
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:546)
com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:364)
com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:154)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
note 根本原因的完整堆栈跟踪可在 JBoss Web/7.0.13.Final 日志中找到。