我正在尝试创建一个简单的 JSF 项目,但 index.jsp 页面未打开并引发异常
javax.faces.FacesException:在第 5 行处理 JSP 页面 /index.jsp 时发生异常
2: <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%> 3: <%@ taglib prefix="h" uri="http://java. sun.com/jsf/html"%> 4:5:6:7:8:
堆栈跟踪:
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:347) org.apache.myfaces.application.jsp.JspViewHandlerImpl.buildView(JspViewHandlerImpl.java:486) org.apache.myfaces.application.jsp。 JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:337)
org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:187) at org.apache.myfaces.webapp.MyFacesServlet.service(MyFacesServlet.爪哇:103)
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) 在 org.jboss.web.tomcat.filters.ReplyHeaderFilter 的 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)。 doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache .catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve .java:190) 在 org.jboss.web.tomcat.security.JaccContextValve。在 org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) 处调用(JaccContextValve.java:92)在 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) 在 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) 在 org.jboss.web.tomcat.service.jca .CachedConnectionValve.invoke(CachedConnectionValve.java:158) 在 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) 在 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330) 在org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828) 在 org.apache.coyote.http11。Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Unknown Source) 原因: org.apache.jasper.JasperException:在第 5 行处理 JSP 页面 /index.jsp 时发生异常
2: <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%> 3: <%@ taglib prefix="h" uri="http://java. sun.com/jsf/html"%> 4:5:6:7:8:
Stacktrace:在 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411) 在 org.apache.jasper.servlet.JspServlet 的 org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:498) .serviceJspFile(JspServlet.java:322) 在 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 在 org.apache。 catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java: 638)在 org.apache.catalina.core 的 org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:444)。ApplicationDispatcher.doForward(ApplicationDispatcher.java:382) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:310) at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:341) ... 26 更多原因:java.lang.RuntimeException:在 javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1672) 的 javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1855) 找不到 FacesContext ) 在 org.apache.jsp.index_jsp._jspx_meth_f_005fview_005f0(index_jsp.java:87) 在 org.apache.jsp.index_jsp._jspService(index_jsp.java:64) 在 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase. java:70) 在 javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 在 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369) ... 36 更多
我认为这是一个服务器错误,但是当我尝试从浏览器访问服务器时。它工作正常。我已经检查了 JSF 库,它也包含在 jboss 服务器下,可以请帮助我...
索引.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<f:view>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<h:outputLabel value="i am here!!!!!!"></h:outputLabel>
</body>
</html>
</f:view>
由于信誉级别,我无法上传文件夹结构的图像..
lib 文件夹不包含任何库,而是位于 javaResources:src 文件夹内的库中。