JSP实例三、sql分页(1)
index.jsp
<%@ page language="java" import="java.sql.*" import="java.lang.*" import="java.util.*" pageEncoding="GB2312"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%!
int CountPage = 0;
int CurrPage = 1;
int PageSize = 5;
int CountRow = 0;
public Connection Con() {
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
Connection Con = DriverManager.getConnection("jdbc:mysql://localhost:3306/userdb?user=root&password=zhz&useUnicode=true&characterEncoding=gb2312");
return Con;
}
catch(Exception e)
{
return null;
}
}
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>利用 SQL 语句实现分页</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description"
相关文档:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Author" content="Jiang Hongbin">
<title>日期选择 - BY ziyue</title>
<script language="JavaScript" type="text/JavaScript">
// 日期选择
var months = new Array ......
<body style="height:100%;">
-------------------------------------------------------------------一开始的页面----------------------
fdasfsdfadf
<input name="button2" onclick="ShopConfirm('fdsaf')" value="点我" type="button"/>
--------------------------------------------------------- ......
因为是跟着视频学习的,有很多用的东西不一样,但是还是慢慢的摸索出来啦!
1.Microsoft JDBC Driver 的下载安装
只要在网上找到资源一步步来就可以了。
2.配置环境变量
我用的是tomcat6.0首先配的是
classpath和path,这些都是在配jdk的时候就配过了,所以就不详细说明了,只要将lib和bin文件加入到相关 ......
我的系统使用acegi登录认证,并且配置用户缓存
<!-- 缓存器,为userCacheBackend提供缓存管理。 -->
<bean id="cacheManager"
class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" />
<!-- EhCache一般用途如下:Hibernate缓存,DAO缓存,安全性凭证缓存(Ace ......
学习JSP主要学习他的9大对象(request, response, pageContext, session, application, out, config, page, exception ),这些对象都是静态对象,不用定义就可以直接使用,把他们都了解清楚并会运用,就可以在简历上添上一个熟悉技能:JSP
Jsp内置对象 功能 主要方法
out 向客户端输出数据 print() println() flush() ......