我有一个jsp文件Trainer.jsp,其中有一个代码
$<f:loadBundle basename="kk.saken.jsf.starter.messages" var="msg" />
问题是'在classpath上找不到资源包jsf.starter.messages'
当我运行Trainer.jsp时,它会显示:
输入例外报告
消息
description服务器遇到内部错误(),导致无法完成此请求。
例外
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)
注意JBoss Web / 7.0.13.Final日志中提供了根本原因的完整堆栈跟踪。
答案 0 :(得分:0)
将kk.saken.jsf.starter.messages
重命名为kk.saken.jsf.starter.messages_en_US
并尝试访问该页面。