MyException - 我的异常网
当前位置:我的异常网» Java Web开发 » JSP条件查询翻页有关问题

JSP条件查询翻页有关问题(4)

www.MyException.Cn  网友分享于:2013-12-11  浏览:1651次

</tr>
</table>

<br>
</body>
</html>

------解决方案--------------------
我现在正在用的,希望能给你点启发
<%@ page contentType= "text/html; charset=gbk " language= "java " import= "java.sql.*,com.v246.sql.*,com.v246.utils.*,java.util.*,com.v246.* " errorPage= " " %>
<%
String thisPageName = request.getRequestURI();
thisPageName = thisPageName.substring(thisPageName.lastIndexOf( "/ ")+1,thisPageName.length());
String type = request.getParameter( "type ");
String disPageName=(Aqu.vacancy(type))?thisPageName+ "? ":thisPageName+ "?type= "+type+ "& ";
Session sessions = new Session();

//分页
Pagination p = sessions.createPagination();//创建用于分页的类
String pageTmp = request.getParameter( "page ");
int pages = 1;
if(!Aqu.vacancy(pageTmp))
{
pages = Integer.parseInt(pageTmp);
}
p.setDisCount(15);//设置分页大小
p.setTable(ArticleConst.infoTable);//设置分页的表
p.setPrimaryKey( "id ");
p.setOrder(Const.desc);
if(!Aqu.vacancy(type))
{
p.setTerm( "type= "+type);
}
ResultSet rs = p.gotoPage(pages);
%>

<html>
<script language= "Javascript1.2 ">
<!-- // load htmlarea
_editor_url = "editor/ "; // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split( "MSIE ")[1]);
if (navigator.userAgent.indexOf( 'Mac ') > = 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf( 'Windows CE ') > = 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf( 'Opera ') > = 0) { win_ie_ver = 0; }
if (win_ie_ver > = 5.5) {
document.write( ' <scr ' + 'ipt src= " ' +_editor_url+ 'editor.js " ');
document.write( ' language= "Javascript1.2 "> </scr ' + 'ipt> ');
} else { document.write( ' <scr '+ 'ipt> function editor_generate() { return false; } </scr '+ 'ipt> '); }
// -->
</script>
<head>

<script language 'javascript '>
function go(type)
{
window.location.href= " <%=thisPageName%> ?type= "+type;
//alert( " <%=thisPageName%> ?type= "+type);

}
</script>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
<title> 健康生活管理 </title>
<link href= "../css/style.css " rel= "stylesheet " type= "text/css ">
<style type= "text/css ">
<!--
.STYLE1 {
font-size: 9pt;
font-weight: normal;
}
.STYLE6 {font-size: 9pt}
.www { font-family: "宋体 ";
font-size: 12px;
}
.STYLE7 { font-size: 14px;
font-weight: bold;
}
-->
</style>
</head>
<body style= "background-color: #cad7f7; ">
<table width= "80% " border= "0 " align= "center " cellpadding= "3 " cellspacing= "1 " class= "STYLE1 ">
<!--DWLayoutTable-->
<tr align= "center " >
<td height= "12 " colspan= "4 " background= "../images/admin_top_bg.gif "> <span class= "STYLE7 "> 后台管理------&gt; <%=ArticleConst.name%> 文章管理 </span> </td>
</tr>
<tr align= "center " >

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有