jsp ¼òµ¥·ÖÒ³
//×ܼǼÊý
int count = personDao.getCount();
//ÿҳÏÔʾ5Ìõ
int pageSize = 5;
//µ±Ç°Ò³
int currentPage = 1;
int pageCount = (count + pageSize - 1) / pageSize;
String _currentPgae = request.getParameter("currentPage");
if (_currentPgae != null) {
currentPage = Integer.parseInt(_currentPgae);
}
if (currentPage < 1) {
currentPage = 1;
}
if (currentPage > pageCount)
currentPage = pageCount;
List list = personDao.getPageList((currentPage - 1) * pageSize,
pageSize);
Iterator it = list.iterator();
&
Ïà¹ØÎĵµ£º
Ò»¡¢JSP¼ò½é
JSP (Java Server Pages)ÊÇ·þÎñÆ÷¶ËµÄ½Å±¾ÓïÑÔ£¬ÊÇÒ»ÖÖÔÚHTMLÒ³ÃæÖмÓÈëJavaÓïÑÔ¶øÉú³É¶¯Ì¬Ò³ÃæµÄ¼¼Êõ£º¼ÓÈëÁËеıêÇ©£¨<%£¬%>£¬…£©¡£
JSPÊÇÒÔJavaºÍServletΪ»ù´¡¿ª·¢¶ø³ÉµÄ¶¯Ì¬ÍøÒ³Éú³É¼¼Êõ£¬ËüµÄµ×²ãʵÏÖÊÇJava Servlet¡£
JSPÒ³ÃæÓÉHTML´úÂëºÍǶÈëÆäÖеÄJava´úÂëËù×é³É¡£·þÎñÆ÷ÔÚÒ³Ãæ±»¿Í» ......
³¤¶ÈÏÞÖÆJavaScript´úÂë
CODE:
<script> function test() { if(document.a.b.value.length>50) { alert("²»Äܳ¬¹ý50¸ö×Ö·û£¡"); document.a.b.focus(); return
false; } } </script> <form. name=a nsubmit="return test()"> <textarea name="b" cols="40" wrap="VIRTUAL" rows="6"></te ......
Ò»¡¢×ܵÄÀ´ËµÕâ¸ö½×¶ÎÖ÷ҪѧϰÁËÒ»ÏÂÕâЩ·½ÃæµÄ֪ʶ
£¨1£©¶ÔÒѾÕÆÎÕÁ˵ÄHTML½øÒ»²½ÊìϤºÍϸ»¯
£¨2£©ÒÔÇ°²»´óÊìϤµÄCSSÓиö¸ü½øÒ»²ãµÄÈÏʶµÄÕÆÎÕ
£¨3£©ÔÚVBscriptµÄ»ù´¡ÉÏÈ«ÃæѧϰÁËjavascript£¬½Å±¾ÓïÑÔ¿é¿ÉÒÔ˵»ù±¾µÄ¶¼Ó¦¸ÃÄÜ×öµÄ³öÀ´¡£
£¨4£©Ç°ÆÚÒ²¶ÔjavaÖеÄTCPÐÒéºÍUDPÐÒéϵͳµÄѧϰÁËÒ»±é£¬Ò²¾ÍÊÇSOCKET±à³ÌÒ»¿ ......
Ê×ÏÈÄãÒªÓÐtomcat,»¹ÒªÓÐoracle jdbcµÄjarµµµÈ»·¾³.
µÚÒ»²½: дJSP
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="java.sql.*"%>
<html>
<body>
<%Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url="jdbc:oracle:thin:@(des ......
jQueryÊÇÄ¿Ç°Ò»¸öºÜÁ÷ÐеÄjs¿ò¼Ü£¬ËüÒ²ÌṩÁ˶ÔajaxºÜºÃµÄÖ§³Ö¡£Ê¹ÓÃajaxÒì²½ÇëÇóÊý¾Ýʱ£¬Èç¹û·þÎñÆ÷·µ»ØµÄÒ»¸öÁбíÊý¾Ý£¬Í¨³£µÄ×ö·¨ÊÇ°ÑÁбíÊý¾Ýת»»³Éjson¸ñʽµÄÊý¾Ý£¬È»ºó·µ»Øµ½Ò³Ã棬ʹÓÃjQuery½øÐнâÎö²¢Óñí¸ñÀ´ÏÔʾ£¬ÕâÒªÇóÄã¶Ôjavascript½âÎöjsonºÜÊì͸¡£
ÎÒÔÚÕâÀïÌṩһÖÖͶ»úÈ¡ÇɵÄ×ö·¨£¬Ê¹ÓÃjQuery·¢ËÍÒì²½ÇëÇó ......