|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
首先java功能强大的背后是其复杂性,就拿web来说,当今流行的框架有很多,什么struts,spring,jQuery等等,而这无疑增加了java的复杂性。js|oracle|信息办理|源代码
//index.jsp改善了的完成分类查询的默许页面
<%@pagecontentType="text/html;charset=big5"%><%@includefile="articleconn1.jsp"%><%
Stringtypes=request.getParameter("types");if(types==null)types="null";
Stringquery=null;Stringsqlname=null;%><html><head><metahttp-equiv="Content-Type"content="text/html;charset=big5"><title>信息查系y</title>
<script>
functionopenwin(id){window.open("view.jsp?id="+id,"","height=450,width=550,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");}
</script><linkrel="stylesheet"href="CSS/style.css"></head>
<bodybgcolor="#FFFFFF"topmargin="0"leftmargin="0"marginwidth="0"marginheight="0"><tablewidth="609"border="0"cellspacing="0"cellpadding="0"align="center"><tr><td><divalign="center"><imgsrc=http://www.163design.net/j/e/"images/TITLE.jpg"width="587"height="174"></div></td></tr></table>
<center>分检察信息:<ahref="index.jsp?types=mp3">>>mp3</a><ahref="index.jsp?types=notebook">>>notebook</a><ahref="index.jsp?types=pc">>>computer</a><ahref="index.jsp?types=mobilephone">>>mobilephone</a></center><divalign="center"></div><tablewidth="607"cellpadding="0"cellspacing="0"align="center"><tr><tdcolspan="3"height="117"><tableborder="1"width="100%"bordercolorlight="#000000"bordercolordark="#FFFFFF"cellpadding="0"cellspacing="0"align="center"><tr><tdheight="16"bgcolor="#B5D85E"width="81%"><divalign="center">
<p><fontcolor="#000000"><strong>信息列表</strong></font></p></div></td></tr><tr><tdwidth="81%"align="center"valign="top"height="139"><divalign="center">
<divalign="center"><divalign="center"><br><br><divalign="center"><palign="left"><%intintPageSize;intintRowCount;//intintPageCount;//intintPage;//面StringstrPage;//定x涤鬟fpageinti,j;intPageSize=5;//定x每@示5lstrPage=request.getParameter("page");//获得前的aif(strPage==null){//判喑跏柬面,假如]有@示,就置榈谝豁intPage=1;}else{intPage=Integer.parseInt(strPage);//strPageD化檎if(intPage<1)intPage=1;}
if(types.equals("null")){sqlname="selectcount(article_id)fromlearning";}else{sqlname="selectcount(article_id)fromlearningwheretypes="+types+"";}
//sqlname="selectcount(article_id)fromlearningwheretitlelike%"+keyword+"%andtypeslike%"+typename+"%orderbyarticle_iddesc";
PreparedStatementps=conn.prepareStatement(sqlname);ResultSetrs1=ps.executeQuery();rs1.next();intRowCount=rs1.getInt(1);//获得整当4媾cintRowCount抵intPageCount=(intRowCount+intPageSize-1)/intPageSize;//算出(+每@示的-1)/每@示的)if(intPage>intPageCount)intPage=intPageCount;
if(types.equals("null")){query="select*fromlearningorderbyarticle_id";}else{query="select*fromlearningwheretypes="+types+"orderbyarticle_id";}
ps=conn.prepareStatement(query);//Stringquery="select*fromlearningorderbyarticle_id";
ResultSetrs=ps.executeQuery(query);//绦sql,依照rg先後排序@示i=(intPage-1)*intPageSize;for(j=0;j<i;j++)rs.next();%><%--O置intPage--%><FORMaction=index.jspmethod=POST><palign=centervAlign=bottom>第<%=intPage%>共<%=intPageCount%><%if(intPage>1){%><ahref="index.jsp?page=<%=intPage-1%>&types=<%=types%>">上一</a><%}%><%if(intPage<intPageCount){%><ahref="index.jsp?page=<%=intPage+1%>&types=<%=types%>">下一</a><%}%></form></div><divalign="center"><center><tableborder="1"cellspacing="0"width="90%"bgcolor="#F0F8FF"bordercolorlight="#000000"bordercolordark="#FFFFFF"background="../images/top-linebg.gif"><tr><tdwidth="15%"align="center"height="20"bgcolor="#B5D85E"><fontcolor="#000000">ID</font></td><tdwidth="45%"align="center"bgcolor="#B5D85E"><fontcolor="#000000">信息名Q</font></td><tdwidth="26%"align="center"bgcolor="#B5D85E"><fontcolor="#000000">上drg</font></td><tdwidth="15%"align="center"bgcolor="#B5D85E"><fontcolor="#000000">c</font></td></tr><%if(intRowCount==0){%>Σ黄穑]有Y料!<%}else{%><%--@示每的Y料(根i的值判嗝宽的5l)--%><%i=0;while(i<intPageSize&&rs.next()){%><tr><tdwidth="15%"height="23"bgcolor="#FFFFFF"><palign="center"><%=rs.getString("article_id")%></td><tdwidth="45%"bgcolor="#FFFFFF"><ahref="javascript:openwin(<%=rs.getString("article_id")%>)"title="<%=rs.getString("title")%>"><%=rs.getString("title")%></a></td><tdwidth="26%"bgcolor="#FFFFFF"><divalign="center"><%=rs.getString("date_and_time")%></div></td><tdwidth="15%"bgcolor="#FFFFFF"><palign="center"><%=rs.getString("hits")%></td></tr><%i++;//通^I圈O置每的}%><%}%></table></center></div><FORMaction=index.jspmethod=POST><palign=centervAlign=bottom>第<%=intPage%>共<%=intPageCount%><%if(intPage>1){%><ahref="index.jsp?page=<%=intPage-1%>&types=<%=types%>">上一</a><%}%><%if(intPage<intPageCount){%><ahref="index.jsp?page=<%=intPage+1%>&types=<%=types%>">下一</a><%}%><br>到第<inputtype="text"name="page"size="5"value="1"/><inputtype="submit"value="_定"class="buttonface"></form><%StringuserName=(String)session.getAttribute("admin");if(userName==null){userName="";}if(userName.equals("admin")){%><ahref="manage.jsp">系y办理</a><%}else{%><ahref="login.jsp">登系y办理</a><%}%></div></div></div></td></tr></table></td></tr></table><%rs.close();
conn.close();%><palign="center">Copyright |
|