有劳各位大侠指点迷津。
Jdk1.4.2装在 C:\j2sdk1.4.2,能够正常运行
Tomcat5.0.28装在 C:\Tomcat 5.0,在root下编写简单的JSP文件可以通过http://localhost:8080打开。
建立文件夹C:\classimport,并且写入classpath环境变量。继续建立子文件夹test.编写javabean文件(包含 package test语句)放在test下,然后从浏览器打开出现http 500 错误如下。
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: /counter.jsp(11,5) Invalid standard action
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.parseStandardAction(Parser.java:1249)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1559)
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:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
环境变量:classpath:.;c:\classimport;C:\MyJava2
Path: c:\j2sdk1.4.2\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\IDM Computer Solutions\UltraEdit-32
------解决方案--------------------
将javaBean .java 文件编译后生成的.class文件拷贝到C:\Tomcat5.0\common\classes下定义的包内(建立包的文件目录)在运行的时候要在.jsp文件中包含包(import语句)。
------解决方案--------------------
tomcat寻找资源的路径不是classpath,而是\common\classes\
代码迷推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.daimami.com/search?q=317