我在做一个简单的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){
税的计算方法
}
}
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){
税的计算方法
}
}
解决方案 »
- 谁能告诉我这段代码是什么意思?在线等!!!
- 项目应该怎样跟别人描述
- 新手求助!解决代码同一时间只能一个用户访问的问题!可否用 Thread ?????????
- JSP中有没可查出正在联接的客户端的端口的方法?
- 上传比较大的文件时出现超时错误,有没有可解决的方案?
- 请问这个配置什么意思啊,在线等
- 初学者!!200分求一简单实例--用JSP JAVA语言,谢谢各位大侠前来!
- 请问但出现Method getWeekDays() not found in class java.text.DateFormatSymbols时,如何办?
- 页面的翻页操作,一定要跟数据库打交道吗?
- java
- java 生成 word 保存到 oracle 数据库
- 求救:tomcat发布没有问题,部署到webshyere就出现下面异常
HTTP Status 500 - --------------------------------------------------------------------------------type Exception reportmessage 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: An error occurred at line: 6 in the generated java file
Only a type can be imported. chapter35.Loan resolves to a packageAn error occurred at line: 14 in the jsp file: /chapter35/ComputeLoan.jsp
Loan cannot be resolved to a type
11: request.getParameter("annualInterestRate"));
12: int numberOfYears = Integer.parseInt(
13: request.getParameter("numberOfYears"));
14: Loan loan =
15: new Loan(annualInterestRate, numberOfYears, loanAmount);
16: %>
17: Loan Amount: <%= loanAmount %><br />
An error occurred at line: 15 in the jsp file: /chapter35/ComputeLoan.jsp
Loan cannot be resolved to a type
12: int numberOfYears = Integer.parseInt(
13: request.getParameter("numberOfYears"));
14: Loan loan =
15: new Loan(annualInterestRate, numberOfYears, loanAmount);
16: %>
17: Loan Amount: <%= loanAmount %><br />
18: Annual Interest Rate: <%= annualInterestRate %><br />
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.这样的错误啊