日期:2014-05-18  浏览次数:20655 次

jsp页面提交页面然后报错的问题
初学JSP遇到以下问题---
index.html页面代码如下
<p> <%@   page   contentType= "text/html;   charset=gb2312 "   language= "java "   import= "java.sql.* "   errorPage= " "   %>
<!DOCTYPE   HTML   PUBLIC   "-//W3C//DTD   HTML   4.01   Transitional//EN "   "http://www.w3.org/TR/html4/loose.dtd ">
<html>
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 ">
<title> 无标题文档 </title>
</head>

<body>
<p   align= "center "> 个人所得税计算器 </p>
<center>
当月总收入
<form   name= "form1 "   method= "post "   action= "list.jsp ">
<p   align= "center "> 当月总收入  
    <input   type= "text "   name= "earning "> <br>
    当月个人所得税起征额
      <input   type= "text "   name= "amount "> <br> </p>
      <input   type= "submit "   name= "S1 "   value= "提交 ">
      <input   type= "reset "   name= "R1 "   value= "重置 ">
</form>
</center>
</body>
</html>


list.jsp页面代码如下
<%@   page   contentType= "text/html;   charset=gb2312 "   language= "java "   import= "java.sql.* "   errorPage= " "   %>
<jsp:useBean   id= "IncomeT "   scope= "request "   class= "accp.IncomeTax "/>

<html>
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 ">
    <title> 显示个人所得税 </title>

</head>
<body> dfff
</body>
</html>

index页面提交以后就报错
org.apache.jasper.JasperException:   /list.jsp(2,0)   The   value   for   the   useBean   class   attribute   accp.IncomeTax   is   invalid
好像是说我的JAVABEAN有问题?
如果我把list.jsp中的 <jsp:useBean> 这行动作去掉的话,就可以正确显示list.jsp页面

但是我就是看不出来我的useBean有问题。。
请大家来帮我看看,万分感谢

------解决方案--------------------
因为你javabean 的构造方法不是公共的 所以出错 加上public 就OK了
========
顺便问你 你哪学软件的?