Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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+AJAX Ìí¼Ó¡¢É¾³ý¶àÑ¡¿ò

±¾ÀýÊDzÉÓÃJSP + Ajax + Îı¾À´ÑÝʾ¶àÑ¡¡¢È«Ñ¡£¬Ìí¼Ó¡¢É¾³ý¡¢¸üÐÂcheckbox¶àÑ¡¿òµÄЧ¹û£»³ä·ÖÕ¹ÏÖÁËÀûÓÃJavaScript¿ØÖÆHTML DOMÒÔ¼°ÀûÓÃXML http ´«µÝÊý¾Ý£¬ÀûÓÃJSP²Ù×÷Îı¾µÄЧ¹û¡£
¡¡¡¡1.JavaScript ÓÃÀ´¿ØÖÆÒ³ÃæÄÚÈݵÄÏÖʵÓëÔöɾЧ¹û£»
¡¡¡¡2.JSP×÷Ϊºǫ́£¬¶ÔÎı¾½øÐжÁÈ¡¡¢Ð´Èë¡¢¸üеȲÙ×÷£»
¡¡¡¡3.Îı¾¸ñʽÊÇÓÃÀ´´ ......

×鯴jsp·½·¨3

<table width=100% border="0" align="center" cellpadding="0"
 cellspacing="0">
 <tr>
  <td height="1" class="gray1"></td>
 </tr>
</table>
<tiles:insert attribute="footer" />
</body>
</html:html> ......

¿´V512ÊÓÆµJsp/Servletѧϰ±Ê¼Ç

//ѧϰ±Ê¼Ç, ¿ÉÄÜÓÐЩµØ·½Àí½âÓÐÎó, »á±í´ï²»Çå³þ
        v512_servlet+jsp
01 ÔÚÐÞ¸ÄÍêCookieºó,Ò»¶¨Òª¼ÓÉÏresponse.addCookie(c);
   CookieÖÐÖ»Äܱ£´æ×Öĸ»òÊý×ÖÐÅÏ¢;
02 req.getSession()Óëreq.getSession(boolean create)
   ÎÞ²ÎÊýµÄ == ÓвÎÊýµÄ²ÎÊýÎ ......

ͨ¹ýJSP³ÌÐòÀ´ÊµÏֵķÖÒ³


ͨ¹ýjsp(SUNÆóÒµ¼¶Ó¦ÓõÄÊ×Ñ¡)³ÌÐò»ñµÃdatabaseÀïµÄÊý¾Ý£¬È»ºóͨ¹ý³ÌÐò¿ØÖÆÆäÏÔʾ·½Ê½£¬ÕâÖÖ·½Ê½Ã÷ÏÔȱµãÊÇÈç¹ûÊý¾ÝÁ¿±È½Ï´óµÄʱºò»áÓÐÃ÷ÏÔµÄÐÔÄÜϽµ
    ÏÖ½«²âÊÔ´úÂë·îÉÏ£¬¾¡¹ÜÎÒ¾¡Á¿ÏÞÖÆ´úÂëµÄ³¤¶È
    ÏÈ˵Ï¿ª·¢²½Ö裻DB½Å±¾£¬²âÊÔ»ñµÃµÄÊý¾ÝÊÇ·ñÕýÈ·µÄÏÔʾÔÚÒ»¸ötableÖУ¬Ìí¼ÓÄÇ ......

jspµ¯³öд°¿Ú´úÂë

¸÷ÀàÍøÒ³µ¯´°´úÂë±àд
¡¡
¾­³£ÉÏÍøµÄÅóÓÑ¿ÉÄܻᵽ¹ýÕâÑùÒ»Ð©ÍøÕ¾£¬Ò»½øÈëÊ×Ò³Á¢¿Ì»áµ¯³öÒ»¸ö´°¿Ú£¬»òÕß°´Ò»¸öÁ¬½Ó»ò°´Å¥µ¯³ö£¬Í¨³£ÔÚÕâ¸ö´°¿ÚÀï»áÏÔʾһЩעÒâÊÂÏî¡¢°æÈ¨ÐÅÏ¢¡¢¾¯
¸æ¡¢»¶Ó­¹â¹ËÖ®ÀàµÄ»°»òÕß×÷ÕßÏëÒªÌØ±ðÌáʾµÄÐÅÏ¢¡£ÆäÊµÖÆ×÷ÕâÑùµÄÒ³ÃæÐ§¹û·Ç³£µÄÈÝÒ×£¬Ö»ÒªÍù¸ÃÒ³ÃæµÄHTMLÀï¼ÓÈ뼸¶ÎJavascript´úÂë¼´¿ÉÊ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ