今天调别人的代码发现错误如下:
HTTP Status 500 -
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: An error occurred at line: 8 in the jsp file: /getStudent.jsp student cannot be resolved to a type 5: <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 6: <title>学生</title> 7: </head> 8: <jsp:useBean id="student" scope="page" class="student"/> 9: <body bgcolor="#0099FF" text="#FFFFFF" link="#33FF00"> 10: <p> 11: <%
说usebean无法联接class的student类,网上查找资料说,要写对类路径,必须加上这个类的包名,但是我看这个类的确直接在src下
默认的包下面新建的类,并没有其他的包名,没办法,后来加了个包名后,就可以访问这个getstudent.jsp页面了。难道usebean必须
加包名才能正确使用类吗。这里写下备后面有何我遇到相同情况的兄弟查阅,如有高手请赐教。