求助JSP高手

来源:百度知道 编辑:UC知道 时间:2024/07/02 12:34:19
本人才开始JSP,这些天遇到些难题,给网页绑定记录集后在IE预览老是提示错误,而没绑前预览很正常。请高手们一定帮我解答。谢谢你们了。

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: Exception in JSP: /news/news_show.jsp:83

80: <td valign="bottom" background="images/news_r1_c10.gif"><table width="100%" height="34" border="0" cellpadding="0" cellspacing="0">
81: <tr>
82: <td width="30%"><img src="images/icons_1.gif" width="38" height="35" border="0" alt=""><img src="images/news_board.jpg" width="150" height="35" border="0" alt=""></td>
83:

java.sql.SQLException: Illegal operation on empty result set.
错误是这一行
newsdetail_data = newsdetail.getObject("news_type"))

错误原因是你的 newsdetail 这个结果集是空的,也就是你的查询没有满足条件的结果,所以你getObject就出现了这个错误。

你的程序里面应该判断
if(newsdetail.next()){
确认有结果集再处理

我来回答,少导入了一个包 java.util.*
这是因为你用的 是 sql 的date的类型
不能获得数据 把 java.sql.*
删了 10451希望对你有帮助!