jsf - 编译 JSF 时的 HTTP 状态 500

标签 jsf jakarta-ee tomcat

在我的 JSF 应用程序中,当我访问 url 时收到 HTTP Status 500 错误。我创建什么网络应用程序并不重要。这个错误发生在我所有的应用程序上。我正在使用 Eclipse Kepler、Tomcat 7 和 Java EE 1.7

问题总是出现在同一代码处,即 f:view 行。

type Exception report

message An exception occurred processing JSP page /index.jsp at line 9

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 9

6: <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
7:  <title>Login Page</title>
8: </head>
9: <f:view>
10:     <center>
11:     Hello World
12:     </center>

最佳答案

您的 JSP 看起来有些奇怪 - 您是否在 View 周围有一个 body 标记,您是否指的是标记库?

这是一个工作示例:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html">
<body>
<f:view>
    <h:outputText value="Hello world!" />
</f:view>
</body>
</html>

(改编自 JSF Toolbox 的示例)

关于jsf - 编译 JSF 时的 HTTP 状态 500,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24636222/

相关文章:

java - 动态 Web 应用程序 - 具有组件的平台

jsf - 使用点 <f :facet> instead of an attribute or a child component

jsf - 字形图标无法正确显示

java - "class is not assignable"是什么意思?

jakarta-ee - 严重 : Exception starting filter struts2 Unable to load configuration. - bean - jar :file:struts2-core-2. 2.3.jar!/struts-default.xml:29:72

Maven Tomcat 插件 - 找不到 404 WebServlet

html - jsf对齐panelgrid中的复选框

google-app-engine - Google App Engine 全局变量 (ServletContext)

jakarta-ee - 在 Quartz 作业中使用 CDI

java - 找不到“org.apache.commons.logging.impl.Log4JLogger”