JDK1.5 + TOMCAT5  為什麼會出現下列問題呢???

cute發表於2004-11-19
為什麼我的很簡單的JSP頁面會出現下面問題??

JDK1.5 + TOMCAT5  為什麼會出現下列問題呢??? 


============== 

type Exception report 

message 

description The server encountered an internal error () that prevented it from fulfilling this request. 

exception 

org.apache.jasper.JasperException: /index.jsp(2,4) Invalid directive 
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:90) 
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:506) 
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.java:810) 
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75) 


note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.

========================================================

我的JSP頁面只有: 

<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %> 

======== 
執行時出現下列問題: 

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 

Generated servlet error: 
F:\jboss-4.0.0\server\default\work\jboss.web\localhost\test\org\apache\jsp\a_jsp.java:3: package javax.servlet does not exist 
import javax.servlet.*; 
^ 


Generated servlet error: 
F:\jboss-4.0.0\server\default\work\jboss.web\localhost\test\org\apache\jsp\a_jsp.java:4: package javax.servlet.http does not exist 
import javax.servlet.http.*; 
^ 


Generated servlet error: 
F:\jboss-4.0.0\server\default\work\jboss.web\localhost\test\org\apache\jsp\a_jsp.java:5: package javax.servlet.jsp does not exist 
import javax.servlet.jsp.*; 
^ 


Generated servlet error: 
F:\jboss-4.0.0\server\default\work\jboss.web\localhost\test\org\apache\jsp\a_jsp.java:8: package org.apache.jasper.runtime does not exist 
public final class a_jsp extends org.apache.jasper.runtime.HttpJspBase 
^ 


Generated servlet error: 
F:\jboss-4.0.0\server\default\work\jboss.web\localhost\test\org\apache\jsp\a_jsp.java:9: package org.apache.jasper.runtime does not exist 
implements org.apache.jasper.runtime.JspSourceDependent { 
^ 


Generated servlet error: 
F:\jboss-4.0.0\server\default\work\jboss.web\localhost\test\org\apache\jsp\a_jsp.java:17: cannot find symbol 
symbol : class HttpServletRequest 
location: class org.apache.jsp.a_jsp 
public void _jspService(HttpServletRequest request, HttpServletResponse response) 
^ 


Generated servlet error: 
F:\jboss-4.0.0\server\default\work\jboss.web\localhost\test\org\apache\jsp\a_jsp.java:17: cannot find symbol 
symbol : class HttpServletResponse 
location: class org.apache.jsp.a_jsp 
public void _jspService(HttpServletRequest request, HttpServletResponse response) 
^ 


Generated servlet error: 
F:\jboss-4.0.0\server\default\work\jboss.web\localhost\test\org\apache\jsp\a_jsp.java:18: cannot find symbol 
symbol : class ServletException 
location: class org.apache.jsp.a_jsp 
throws java.io.IOException, ServletException { 
^ 


Generated servlet error: 
F:\jboss-4.0.0\server\default\work\jboss.web\localhost\test\org\apache\jsp\a_jsp.java:20: cannot find symbol 
symbol : class JspFactory 
location: class org.apache.jsp.a_jsp 
JspFactory _jspxFactory = null; 
^ 


Generated servlet error: 
F:\jboss-4.0.0\server\default\work\jboss.web\localhost\test\org\apache\jsp\a_jsp.java:21: cannot find symbol 
symbol : class PageContext 
location: class org.apache.jsp.a_jsp 
PageContext pageContext = null; 
^ 


Generated servlet error: 
F:\jboss-4.0.0\server\default\work\jboss.web\localhost\test\org\apache\jsp\a_jsp.java:22: cannot find symbol 
symbol : class HttpSession 
location: class org.apache.jsp.a_jsp 
HttpSession session = null; 
^ 


Generated servlet error: 
F:\jboss-4.0.0\server\default\work\jboss.web\localhost\test\org\apache\jsp\a_jsp.java:23: cannot find symbol 
symbol : class ServletContext 
location: class org.apache.jsp.a_jsp 
ServletContext application = null; 
<p class="indent">

相關文章