急,我做的WAP现在在一个ACCEPT。JSP里实现翻页老是有问题,说找不到网页。它的原码如下:
我现在在一个ACCEPT。JSP里实现翻页老是有问题,说找不到网页。它的原码如下:<%@ page contentType="text/vnd.wap.wml; charset=utf-8" %>
<jsp:useBean id="conn" scope="session" class="xdx.connect"/>
<jsp:useBean id="iso" scope="session" class="xdx.isotobgk"/>
<jsp:useBean id="conver" scope="session" class="wapserver.GconvertS"/>
<%System.out.println("good3");
int j=1;
int initcount=1;
String strthree="";
String key="";
String keyword=request.getParameter("keyword");
System.out.println("keyword:"+keyword);
key=iso.converthree(keyword);
System.out.println("god");
String strone="select company_id, company_name from base_dic where company_name like '%"+key+"%'";
String strtwo="select count(company_name) from base_dic where company_name like '%"+key+"%'";
//System.out.println(strone);
java.sql.Connection con=conn.BulidConnection();
java.sql.ResultSet rs=conn.RowCount1(con, strone);
int rowcount=0;
java.sql.ResultSet rstwo=conn.RowCount1(con, strtwo);
//System.out.println(str);
if(rstwo.next())
{rowcount=rstwo.getInt(1);}
//if(initcount==""||initcount==null)
// {initcount=0;}
//System.out.println(str);
initcount=Integer.parseInt(request.getParameter("initcount"));
//System.out.println(str);
for(int k=0;k<5*(initcount-1);k++)
{
rs.next();}
int pagecount=(rowcount+5-1)/5;
System.out.print("pagecount:"+pagecount);
//System.out.print("good");
%><?xml version="1.0" encoding="gb2312"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.dtd" >
<wml id="sds" xml:lang="zh_CN">
<card id="card1" title="搜浪">
<p>
<%//if(rs!=null){
%>
<% while(rs.next()&j<6)
{int companid=0;
companid=rs.getInt(1);
strthree=" ";
strthree=rs.getString(2);
strthree=conver.gconvertx(strthree);
%>
<%=j%><a href="companyinfo.jsp?nameid=<%=companid%>"> <%=strthree%></a><br/>
<%j++;
}con.close();%>
<%if(j<=1)
{%>
对不起没有你搜索的
<%}%>
</p>
<%if(initcount<pagecount&pagecount>1){%>
<p>
<a href="/accept/accept.jsp?initcount=<%=(initcount+1)%>&keyword=<%=key%>">next</a>
</p>
<%}else if(initcount>1){%>
<p>
<a href="/accept/accept.jsp?initcount=<%=(initcount-1)%>&keyword=<%=key%>">上一页</a></p>
<%}%>
<p align="center">
<a href="/index.wml">回到搜浪首页</a>
</p>
</card>
</wml>
问题点数:0、回复次数:3Top
1 楼viano(优秀是一种习惯!)回复于 2005-01-03 13:23:13 得分 0
找不到一定是路进的问题了!Top
2 楼redex(cc)回复于 2005-01-03 14:48:09 得分 0
应该是翻页的逻辑有问题吧,楼主再检查检查.Top
3 楼awpking(星星是靠灌水灌来的)回复于 2005-01-03 20:18:57 得分 0
看的有点晕啊,呵呵,帮你up~~Top




