在我的 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/