易截截图软件、单文件、免安装、纯绿色、仅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登录界面+access


1、用户登录界面log.jsp
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content ......

jsp自定义标签开发

不处理体内容的标签理解一下图片1
处理体内容标签理解提图片2
1:JspWriter out = pageContext.getOut();
2:BodyContent bc = this.getBodyContent();
 3:String input = bc.getString();
 4:JspWriter out = bc.getEnclosingWriter();
不处理体内容
第一行代码为不处理标签体内容时拿到需要的输出到页 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号