请英雄赐教,关于"伺候器遇到了阻止它实现这一个请求的一个内在的错误 () 。"
我在ROOT目录下放置了一个JSP文件time.jsp,内容如下
<%@ page language= "java " contentType= "text/html;charset=GBK "%>
<%@ page mport= "java.util.* " %>
<%
date dnow=new Date();
int dhours=dnow.getHours();
int dminutes=dnow.getMinutes();
int dseconds=dnow.getSeconds();
out.print( "服务器时间 "+ ": "+dhours+ ": "+dminutes+ ": "+dseconds);
%>
<script language= "javaScript ">
var dnow=new date();
dhours=dnow.getHours();
dminutes=dnow.getMinutes();
dseconds=dnow.getSeconds();
document.write( " <br> 浏览器时间: "+dhours+ ": "+dminutes+ ": "+dseconds);
</script>
在浏览器中请求"http://localhost:8080/time.jsp
时TOMCAT:出现这样的错误信息:
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: /myJsp.jsp(1,1) Unterminated <%@ page tag
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:134)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:511)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet
请问这是什么原因呀?
我在请求另一个JSP文件nyJsp.jsp时,tomcat没有报错,但是浏览器弹出提示你保存该文件的窗口,而不是显示这个文件内容,这又是什么原因呢?
以下是nyJsp.jsp的源代码:
<%@page contentType= "test/html;charset=GBK "%>
<%!int number=0;
synchronized void countPeople(){
number++;
}
%>
<%
countPeople();
%>
您是第 <%out.println(number);%> 个访问本站的客户。
------解决方案--------------------org.apache.jasper.
JasperException: /myJsp.jsp(1,1) Unterminated <%@ page tag
<%@ 没有结束,好好检查一下.
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.myexception.cn/java-web/317.html