usebean class属性有无包名问题

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

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值