usebean class属性有无包名问题

来源:互联网 发布:成都高新区 淘宝 编辑:程序博客网 时间:2024/05/10 08:19

今天调别人的代码发现错误如下:

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.jspstudent cannot be resolved to a type5: <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必须
加包名才能正确使用类吗。这里写下备后面有何我遇到相同情况的兄弟查阅,如有高手请赐教。

原创粉丝点击