标题:求哪位大神看看代码为什么就报错了呢?
取消只看楼主
w602720345
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2016-5-1
 问题点数:0 回复次数:0 
求哪位大神看看代码为什么就报错了呢?
<jsp:include page="../cust/top.jsp" />
        <table width=750 align="center" border=0 class=td>
            <tr>
                <td width=25% valign="top">
                    <jsp:include page="declare.jsp" /><br />
                    <jsp:include page="login.jsp" />
                </td>
                <td width=75% valign="top">
                    <!-- 精品图书 -->
                    <table width=100% border=0 class=td>
                        <tr>
                            <td colspan=2 align="left">
                                <img src="img/lanmu_r1.jpg" width=85 height=29 />
                            </td>
                        </tr>
                        <%
                            int i_num = 2;
                            rs = stmt.executeQuery("select * from book left join publisher on book.publisherid=publisher.publisherid where type=2");
                            while (rs.next() && i_num > 0) {
                                i_num--;
                                String s_bookid = rs.getString("bookid");
                                String s_bookname = rs.getString("bookname");
                                String s_author = rs.getString("author");
                                String s_pubdate = rs.getString("pubdate").substring(0, 10);
                                String s_price = rs.getString("price");
                                String s_content = rs.getString("content");
                                String s_picture = rs.getString("picture");
                                String s_pubname = rs.getString("name");
                        %>
                        <tr>
                            <td width=30%>
                                <table bgcolor=#98dacf border=0 class=td>
                                    <tr>
                                        <td>
                                            <a href="cust/bookdetail.jsp?bookid=<%=s_bookid%>"> <img
                                                    src="img/<%=s_picture%>" width=65 height=90 border=0 /> </a>
                                        </td>
                                        <td>
                                            <table border=0 class=td>
                                                <tr>
                                                    <td width=25%>
                                                        书名
                                                    </td>
                                                    <td>
                                                        <%=s_bookname%>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width=25%>
                                                        作者
                                                    </td>
                                                    <td>
                                                        <%=s_author%>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width=25%>
                                                        出版社
                                                    </td>
                                                    <td>
                                                        <%=s_pubname%>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width=25%>
                                                        出版日期
                                                    </td>
                                                    <td>
                                                        <%=s_pubdate%>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width=25%>
                                                        定价
                                                    </td>
                                                    <td>
                                                        ¥<%=s_price%>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan=2>
                                            <a href="cust/addtocart.jsp?bookid=<%=s_bookid%>">放入购物车</a>
                                            <a href="cust/bookdetail.jsp?bookid=<%=s_bookid%>">查看详情</a>
                                        </td>
                                    </tr>

                                </table>
                            </td>
加入一下代码后就出错了!!!!

                            <%
                                if (!rs.isLast()) {//是否是最后一条记录
                                        rs.next();
                                        s_bookid = rs.getString("bookid");
                                        s_bookname = rs.getString("bookname");
                                        s_author = rs.getString("author");
                                        s_pubdate = rs.getString("pubdate").substring(0, 10);
                                        s_price = rs.getString("price");
                                        s_content = rs.getString("content");
                                        s_picture = rs.getString("picture");
                                        s_pubname = rs.getString("name");
                            %>
                            <td width=30%>
                                <table bgcolor=#54ca21 border=0 class=td>
                                    <tr>
                                        <td>
                                            <a href="cust/bookdetail.jsp?bookid=<%=s_bookid%>"> <img
                                                    src="img/<%=s_picture%>" width=65 height=90 border=0 /> </a>
                                        </td>
                                        <td>
                                            <table border=0 class=td>
                                                <tr>
                                                    <td width=25%>
                                                        书名
                                                    </td>
                                                    <td>
                                                        <%=s_bookname%>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width=25%>
                                                        作者
                                                    </td>
                                                    <td>
                                                        <%=s_author%>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width=25%>
                                                        出版社
                                                    </td>
                                                    <td>
                                                        <%=s_pubname%>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width=25%>
                                                        出版日期
                                                    </td>
                                                    <td>
                                                        <%=s_pubdate%>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td width=25%>
                                                        定价
                                                    </td>
                                                    <td>
                                                        ¥<%=s_price%>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan=2>
                                            <a href="cust/addtocart.jsp?bookid=<%=s_bookid%>">放入购物车</a>
                                            <a href="cust/bookdetail.jsp?bookid=<%=s_bookid%>">查看详情</a>
                                        </td>
                                    </tr>

                                </table>
                            </td>
                            <%
                                }
                            %>
                        </tr>
                        <%
                            }
                        %>

                    </table>

一下是错误页面
HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: ??????????????
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
    org.apache.jsp.cust.index_jsp._jspService(index_jsp.java:532)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
root cause

com.microsoft.sqlserver.jdbc.SQLServerException: ??????????????
    com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:171)
    com.microsoft.sqlserver.jdbc.SQLServerResultSet.throwNotScrollable(SQLServerResultSet.java:375)
    com.microsoft.sqlserver.jdbc.SQLServerResultSet.verifyResultSetIsScrollable(SQLServerResultSet.java:398)
    com.microsoft.sqlserver.jdbc.SQLServerResultSet.isLast(SQLServerResultSet.java:1185)
    org.apache.jsp.cust.index_jsp._jspService(index_jsp.java:204)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
note The full stack trace of the root cause is available in the Tomcat logs.
搜索更多相关主题的帖子: include border center 
2016-05-01 14:10



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-464293-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.629438 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved