当前位置: 代码迷 >> Web开发 >> 请问jsp文件page指令报错的有关问题
  详细解决方案

请问jsp文件page指令报错的有关问题

热度:519   发布时间:2012-03-30 17:32:10.0
请教jsp文件page指令报错的问题
我写的一个jsp文件的前面是: 
<% @ page language="java" errorPage="error.jsp" contentType="text/html ;charset=gbk"%>但是浏览器针对这一行报了这么多错:
An error occurred at line: 1 in the jsp file: /Divide.jsp
Syntax error on token "language", VariableDeclaratorId expected after this token
1: <% @ page language="java" errorPage="error.jsp" contentType="text/html ;charset=gbk"%>
2: <html><title>Divide</title>
3: <body>
4: <%


An error occurred at line: 1 in the jsp file: /Divide.jsp
language cannot be resolved to a type
1: <% @ page language="java" errorPage="error.jsp" contentType="text/html ;charset=gbk"%>
2: <html><title>Divide</title>
3: <body>
4: <%


An error occurred at line: 1 in the jsp file: /Divide.jsp
Syntax error, insert ";" to complete LocalVariableDeclarationStatement
1: <% @ page language="java" errorPage="error.jsp" contentType="text/html ;charset=gbk"%>
2: <html><title>Divide</title>
3: <body>
4: <%


An error occurred at line: 1 in the jsp file: /Divide.jsp
errorPage cannot be resolved
1: <% @ page language="java" errorPage="error.jsp" contentType="text/html ;charset=gbk"%>
2: <html><title>Divide</title>
3: <body>
4: <%


An error occurred at line: 1 in the jsp file: /Divide.jsp
Syntax error, insert ";" to complete Statement
1: <% @ page language="java" errorPage="error.jsp" contentType="text/html ;charset=gbk"%>
2: <html><title>Divide</title>
3: <body>
4: <%


An error occurred at line: 1 in the jsp file: /Divide.jsp
contentType cannot be resolved
1: <% @ page language="java" errorPage="error.jsp" contentType="text/html ;charset=gbk"%>
2: <html><title>Divide</title>
3: <body>
4: <%


An error occurred at line: 1 in the jsp file: /Divide.jsp
Syntax error, insert ";" to complete Statement
1: <% @ page language="java" errorPage="error.jsp" contentType="text/html ;charset=gbk"%>
2: <html><title>Divide</title>
3: <body>
4: <%

我算是彻底崩溃了,似乎浏览器根本就不认识 @ page 标志,哪位大哥也遇到过此类情形,求指教。



------解决方案--------------------
< % @之间不能有空格
------解决方案--------------------
<% @
有一个空格在它俩之间 删了
  相关解决方案