jsp·ÖÒ³
Ô´³ÌÐò
<%String sConn="ÄãµÄÁ¬½Ó"
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn=DriverManager.getConnection(sConn,"ÄãµÄÓû§Ãû","ÃÜÂë");
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
Statement stmtcount=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
ResultSet rs=stmt.executeQuery("select * from mytable_view");
String sqlcount="select count(*) from mytable_view";
ResultSet rscount=stmtcount.executeQuery(sqlcount);
int pageSize=ÄãµÄÿҳÏÔʾ¼Í¼Êý£»
int rowCount=0; //×ܵļǼÊý
while (rscount
int pageCount; //×ܵÄÒ³Êý
int currPage; //µ±Ç°Ò³Êý
String strPage;
strPage=request.getParameter("page");
if (strPage==null){
currPage=1;
}
else{
currPage=Integer.parseInt(strPage);
if (currPage<1) currPage=1;
}
pageCount=(rowCount+pageSize-1)/pageSize;
if (currPage>pageCount) currPage=pageCount;
int thepage=(currPage-1)*pageSize;
int n=0;
rs.absolute(thepage+1);
while (n<(pageSize)&&!rs
%>
<%rs.close();
rscount.close();
stmt.close();
stmtcount.close();
conn.close();
%>
//ÏÂÃæÊÇ µÚ¼¸Ò³µÈ
<form name="sinfo" method="post" action="sbinfo_index.jsp?condition=<%=condition%>&type=<%=type%>" onSubmit="return testform(this)">
µÚ<%=currPage%>Ò³ ¹²<%=pageCount%>Ò³ ¹²<%=rowCount%>Ìõ
<%if(currPage>1){%><a href="sbinfo_index.jsp?condition=<%=condition%>&type=<%=type%>">Ê×Ò³</a><%}%>
<%if(currPage>1){%><a href="sbinfo_index.jsp?page=<%=currPage-1%>&condition=<%=condition%>&type=<%=type%>">ÉÏÒ»Ò³</a><%}%>
<%if(currPage<pageCount){%><a href="sbinfo_index.jsp?page=<%=currPage+1%>&condition=<%=condition%>&type=<%=type%>">ÏÂÒ»Ò³</a><%}%>
<%if(pageCount>1){%><a href="sbinfo_index.jsp?page=&l
Ïà¹ØÎĵµ£º
½ñÌì¸ÕÇÉÅöµ½ºÍJSP×¢ÊÍÓеã¹ØϵµÄÒ»¸öÎÊÌâ¡£ËùÒÔ×ö¸ö±Ê¼Ç£¬ËµÃ÷Ò»ÏÂÏÔʽעÊÍ<!-- comments --> ºÍÒþʽעÊÍ<%-- comments --%> Ö®¼äµÄÁ½µã²î±ð¡£
Ôø¾ÒÔΪÏÔʽעÊͺÍÒþʽעÊͲî±ðÖ»ÓÐÔÚ´úÂëÏÔʾÉÏ£¬ÕâµãÓ¦¸Ã´ó¼Ò¶¼ÖªµÀ£¬ÏÔʽעÊÍ»áÏÔʾÔÚ¿Í»§¶ËÒ³ÃæÔ´ÂëÖУ¬¶øÒþʽעÊÍÊÇ¿´²»µ½µÄ£¬²»¹ýÕâÖ»ÊǵÚÒ»µã¡£
......
±¾ÀýÊDzÉÓÃJSP + Ajax + Îı¾À´ÑÝʾ¶àÑ¡¡¢È«Ñ¡£¬Ìí¼Ó¡¢É¾³ý¡¢¸üÐÂcheckbox¶àÑ¡¿òµÄЧ¹û£»³ä·ÖÕ¹ÏÖÁËÀûÓÃJavaScript¿ØÖÆHTML DOMÒÔ¼°ÀûÓÃXML http ´«µÝÊý¾Ý£¬ÀûÓÃJSP²Ù×÷Îı¾µÄЧ¹û¡£
¡¡¡¡1.JavaScript ÓÃÀ´¿ØÖÆÒ³ÃæÄÚÈݵÄÏÖʵÓëÔöɾЧ¹û£»
¡¡¡¡2.JSP×÷Ϊºǫ́£¬¶ÔÎı¾½øÐжÁÈ¡¡¢Ð´Èë¡¢¸üеȲÙ×÷£»
¡¡¡¡3.Îı¾¸ñʽÊÇÓÃÀ´´ ......
<html:html>
<HEAD>
<tiles:insert attribute="header" />
</HEAD>
<body>
<tiles:insert attribute="top" />
<table width="100%" height="400" border="0" align="center"
cellpadding="0" cellspacing="0">
<tr>
<td width="178" ......
<%@page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="org.springframework.context.ApplicationContext"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@page import="ccp.suddenattack.service.news.*"%>
......