我按照书上所说,把HelloWorldDemo.jsp放在了Tomcat7\webapps\Root中。
运行时,以下是错误信息:
----------------
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 1 in the jsp file: /HelloWorldDemo.jsp
Syntax error on token "language", VariableDeclaratorId expected after this token
1: <% @ page language="java" contentType="text/html; charset=gb2312" pageEncoding="gb2312" %>
2:
3: <html>
4: <head>
An error occurred at line: 1 in the jsp file: /HelloWorldDemo.jsp
language cannot be resolved to a type
1: <% @ page language="java" contentType="text/html; charset=gb2312" pageEncoding="gb2312" %>
2:
3: <html>
4: <head>
An error occurred at line: 1 in the jsp file: /HelloWorldDemo.jsp
Syntax error, insert ";" to complete LocalVariableDeclarationStatement
1: <% @ page language="java" contentType="text/html; charset=gb2312" pageEncoding="gb2312" %>
2:
3: <html>
4: <head>
----------------
以下是HelloWorldDemo.jsp内容:
<% @ page language="java" contentType="text/html; charset=gb2312" pageEncoding="gb2312" %>
<html>
<head>
<title>第一个JSP程序</title>
</head>
<body>
<% String greeting= "Hello, World!";
out.println(greeting);
%>
</body>
</html>
错在哪里?
--
FROM 221.217.99.*