易截截图软件、单文件、免安装、纯绿色、仅160KB

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"


相关文档:

jsp通过div实现覆盖,弹出新窗体

<body style="height:100%;">
-------------------------------------------------------------------一开始的页面----------------------
fdasfsdfadf
<input name="button2" onclick="ShopConfirm('fdsaf')" value="点我" type="button"/>
--------------------------------------------------------- ......

jsp登录验证代码


image.jsp用于生成数字图片
<%@ page contentType="image/jpeg;charset=gb2312" import="java.awt.*,
java.awt.image.*,java.util.*,javax.imageio.*" %>
<%!
Color getRandColor(int fc,int bc){//给定范围获得随机颜色
          Random random = new Rand ......

jsp验证码代码

在开发中验证码是比较常用到有效防止这种问题对某一个特定注册用户用特定程序破解方式进行不断的登陆尝试的方式。
此演示程序包括三个文件:
1.login.jsp:登录页面
2.code.jsp:生成验证码图片页面
3.check.jsp:验证结果
code.jsp
 程序代码 ==================================================
<%@ page co ......

jsp文件下载完整方法

第一种:
就是直接给出下载的地址,这种方式很不好,因为会暴露你的地址,带来很多不安全的因素,可以说是千万不要用这种
第二种:
下载页面
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<html>
<head>
<title>download</title>
</head>
< ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号