求助大家。。。jsp引包,出现了500错误。。。
我在做一个简单的jsp页面,主要是:在包chapter35中创建一个新的类ComputeTax.java,然后在jsp中导入这个类。。。最后运行时出现了500的错误。。。求助各位大侠前辈啊
jsp的代码如下:
<%@ page import="ComputeTax"%>
<html>
<head>
<title>ComputeTax</title>
</head>
<body>
<%
String status=request.getParameter("status");
double income=Double.parseDouble(request.getParameter("income"));
double tax=computeTax(income);
out.println("Taxable Income: <b>"+income+"</b><br>");
out.println("Filing Status: <b>"+status+"</b><br>");
out.println("Tax: <b>"+tax+"</b><br>");
%>
</body>
</html>
我的java源代码的主要代码如下:
public class ComputeTax {
double computeTax(double income){
税的计算方法。。。
}
}
[解决办法]
找不到这个页面,你把你的那个类放在一个包里面再试试呢?
[解决办法]
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:349)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.26 logs.
这样的错误啊
[解决办法]
这问题,报错的源文件在哪里啊?
[解决办法]
额 你的包的路径看看有木有问题<%@ page import="ComputeTax"%>
[解决办法]
你贴的500错误 和你创建的ComputeTax类没关系啊 , Loan cannot be resolved to a type 。。。
[解决办法]
double tax=computeTax(income); 可以这样玩? 。。。