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

´¿JSP·ÖÒ³´úÂë

<%@ page contentType="text/html; charset=gb2312" %>
<%@ page language="java" %>
<%@ page import="java.sql.*" %>
<%
//Çý¶¯³ÌÐòÃû
String driverName="org.gjt.mm.mysql.Driver";
//Êý¾Ý¿âÓû§Ãû
String userName="root";
//ÃÜÂë
String userPasswd="<>?KL:IOP*()";
//Êý¾Ý¿âÃû
String dbName="gb_winguo_db";
//±íÃû
String tableName="keyword_type";
//Áª½á×Ö·û´®
String url="jdbc:mysql://127.0.0.1/"+dbName+"?user="+userName+"&password="+userPasswd;
Class.forName(driverName).newInstance();
Connection connection=DriverManager.getConnection(url);
Statement statement = connection.createStatement();
//ÿҳÏÔʾ¼Ç¼Êý
int PageSize = 20;
int StartRow = 0; //¿ªÊ¼ÏÔʾ¼Ç¼µÄ±àºÅ
int PageNo=0;//ÐèÒªÏÔʾµÄÒ³Êý
int CounterStart=0;//ÿҳҳÂëµÄ³õʼֵ
int CounterEnd=0;//ÏÔʾҳÂëµÄ×î´óÖµ
int RecordCount=0;//×ܼǼÊý;
int MaxPage=0;//×ÜÒ³Êý
int PrevStart=0;//ǰһҳ
int NextPage=0;//ÏÂÒ»Ò³
int LastRec=0;
int LastStartRecord=0;//×îºóÒ»Ò³¿ªÊ¼ÏÔʾ¼Ç¼µÄ±àºÅ
//»ñÈ¡ÐèÒªÏÔʾµÄÒ³Êý£¬ÓÉÓû§Ìá½»
if(request.getParameter("PageNo")==null){ //Èç¹ûΪ¿Õ£¬Ôò±íʾµÚ1Ò³
if(StartRow == 0){
PageNo = StartRow + 1; //É趨Ϊ1
}
}else{
PageNo = Integer.parseInt(request.getParameter("PageNo")); //»ñµÃÓû§Ìá½»µÄÒ³Êý
StartRow = (PageNo - 1) * PageSize; //»ñµÃ¿ªÊ¼ÏÔʾµÄ¼Ç¼±àºÅ
}
//ÒòΪÏÔʾҳÂëµÄÊýÁ¿ÊǶ¯Ì¬±ä»¯µÄ
//¼ÙÈç×ܹ²ÓÐÒ»°ÙÒ³£¬Ôò²»¿ÉÄÜͬʱÏÔʾ100¸öÁ´½Ó
//¶øÊǸù¾Ýµ±Ç°µÄÒ³ÊýÏÔʾһ¶¨ÊýÁ¿µÄÒ³ÃæÁ´½Ó
//ÉèÖÃÏÔʾҳÂëµÄ³õʼֵ
if(PageNo % PageSize == 0){
CounterStart = PageNo - (PageSize - 1);
}else{
CounterStart = PageNo - (PageNo % PageSize) + 1;
}
CounterEnd = CounterStart + (PageSize - 1);
%>
<html>
<head>
<title>·ÖÒ³ÏÔʾ¼Ç¼</title>
<link rel="stylesheet" href="style.css" mce_href="style.css" type="text/css">


Ïà¹ØÎĵµ£º

Óà MyEclipse ¿ª·¢µÄ Hibernate + JSP ·ÖÒ³´úÂë

ÏÂÔØºóµ¼ÈëÏîÄ¿µ½ MyEclipse , È»ºóÐÞ¸ÄÊý¾Ý¿âÁ¬½Ó²ÎÊý¼´¿É²âÊÔ. ÎÒÕâÓõÄÊÇ MySQL Êý¾Ý¿â. Óà JSP ÊÇÒòΪ Hibernate ¿ÉÒÔÅäºÏ¸÷ÖÖ¿ò¼Ü, Òò´ËÔÚ´úÂëÀïÎÒÒѾ­¾¡Á¿µÄ°ÑÒ³ÃæºÍºǫ́µÄÖ±½Ó±äÁ¿ñîºÏ·Ö¸ô¿ªÁË.
hibernate_page.zip 433KB
²¿·Ö´úÂëÏÔʾ:
Ïà¹Ø SQL:
CREATE TABLE `user` (
`id` int(11) NOT NULL,
`u ......

jspÒ³ÃæÓйرàÂëµÄ¹Ø¼ü´Ê½âÊÍ

<%@ page contentType=”text/html; charset=GB2312″ %>
<META http-equiv=Content-Type content=”text/html; charset=gb2312″>
 
pageEncoding ÊÇjspÎļþ±¾ÉíµÄ±àÂë
contentTypeµÄcharsetÊÇ·þÎñÆ÷·¢Ë͸ø¿Í»§¶ËµÄÄÚÈݵıàÂë¡£
 
 
ÔÚÍøÒ³µÄHTMLÔ´´úÂëÖÐÒ»¸öÖØÒªµ ......

jspÖжÁÈ¡propertiesÎļþ

jspÖжÁÈ¡propertiesÎļþ£¬²¢°ÑÖµÉèµ½js±äÁ¿ÖУº
web_stderr.propertiesÎļþÄÚÈÝ£º
common.username.error.null = UserName can not be null.
common.username.error.invalid = UserName is invalid.
common.password.error.null = Password can not bu null.
common.password.error.invalid = Password is invalid.
......

ÇóÖú jspÂÛ̳ÄǵãÊÂ

¿ª·¢»·¾³£ºtomcat+sql server 2000+dreamweaver
Õâ¶Îʱ¼äÐèÒª ½¨Á¢¸ö»ùÓÚjspµÄÂÛ̳£¬ºÜ¼ò½àµÄ ÓÉÓÚÒÔǰ»ù´¡²»ºÃ ¹âÅäÖû·¾³¾Í¸ãÁËÁ½Ìì
ÏÖÇë¸÷λÅóÓѰïæ ¸ø¸ö jspÂÛ̳µÄ´úÂë+Êý¾Ý¿â±¸·Ý ÄãÃǵÄÁ·ÊÖ×÷Æ·Ò²ÐÐ ÔÚ¹ý¼¸Ìì¾ÍÒªÓÃÁË
µ½ÏÖÔÚ»¹Í£ÁôÔÚǰ̨ Ï£ÍûÄÄλÅóÓѰï°ïÎÒ ÏÈллÁË
zhenguo.gg@gmail.com ......

jspÒ³ÃæÏòflash´«µÝ²ÎÊý

ActioÖд«µÝ²ÎÊý
  request.setAttribute("userName",fbName);
  request.setAttribute("passWord",pwd);
  request.setAttribute("CDNUrl",CDNUrl);
-------------------------------------------------------------------
AC_FL_RunContent(
 'codebase', 'http://download.macromed ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ