在我的JSF应用程序中,当我访问url时出现HTTP Status 500错误。我创建的Web应用程序并不重要。我的所有应用都会出现此错误。我正在使用Eclipse Kepler,Tomcat 7和Java EE 1.7
问题总是出现在f:view line的相同代码中。
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>
答案 0 :(得分:0)
你的JSP看起来有点奇怪 - 你是否在视图周围有一个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的例子)