jspÖÐList,ArrayListµÄʹÓ÷½·¨
public static List getPageUser(int currentPage) throws Exception {//?List
Connection conn = null;
PreparedStatement prep = null;
ResultSet rs = null;
List result = new ArrayList();// ½Ó¿Ú List<E>£¬ ´Ë½Ó¿ÚµÄÓû§¿ÉÒÔ¶ÔÁбíÖÐÿ¸öÔªËصIJåÈëλÖýøÐо«È·µØ¿ØÖÆ¡£Óû§¿ÉÒÔ¸ù¾ÝÔªËصÄÕûÊýË÷Òý£¨ÔÚÁбíÖеÄλÖã©·ÃÎÊÔªËØ£¬²¢ËÑË÷ÁбíÖеÄÔªËØ¡£
public class ArrayList<E>extends AbstractList<E>implements List<E>, RandomAccess, Cloneable,SerializableList ½Ó¿ÚµÄ´óС¿É±äÊý×éµÄʵÏÖ¡£ÊµÏÖÁËËùÓпÉÑ¡Áбí²Ù×÷£¬²¢ÔÊÐí°üÀ¨ null ÔÚÄÚµÄËùÓÐÔªËØ¡£³ýÁËʵÏÖ List ½Ó¿ÚÍ⣬´ËÀ໹ÌṩһЩ·½·¨À´²Ù×÷ÄÚ²¿ÓÃÀ´´æ´¢ÁбíµÄÊý×éµÄ´óС¡£
try {
conn = new DBConnection().getConnection();
int rowCount = getCount();//·µ»ØÓû§×ÜÊý
int pageSize = getPageSize();//
//Ó¦»ñÈ¡µÄ¼Ç¼Êý
int rows = (rowCount - (currentPage - 1) * getPageSize()) >
getPageSize() ?
pageSize : (rowCount - (currentPage - 1) * getPageSize());
//Óû§×ÜÊý-£¨µ±Ç°Ò³ºÅ-1£©*¹Ì¶¨Ò³´óС¡µÒ³´óС£¿Õý³£Ò³ ´óС
Ïà¹ØÎĵµ£º
Jsp³£Óü¼ÇÉ:ͼƬÑéÖ¤Âë
2009Äê10ÔÂ30ÈÕ ÐÇÆÚÎå 21:06
˼·
£º
ͼƬÑéÖ¤ÂëµÄʵÏÖÖ÷ÒªµÄ¼¼ÊõµãÊÇÈçºÎÉú³ÉÒ»¸öͼƬ¡£Éú³ÉͼƬ¿ÉÒÔʹÓÃjava.awt°üϵÄÀàÀ´ÊµÏÖ¡£ÎÒÃÇÏÈдһ¸ö¼òµ¥µÄÉú³ÉͼƬµÄ³ÌÐòHelloImage.java¡£ÒÔÏÂÊÇ´úÂ벿·Ö¡£
package com.vogoal.test;
import java.awt.Color;
import
java.awt.Graphics;
imp ......
package com.demo.filter;
import javax.servlet.Filter;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.FilterChain;
import java.io.IOException;
public class SetCharacterEn ......
<?xml version="1.0" encoding="gb2312" ?>
<?xml-stylesheet type="tet/css" href="mystyle.css" ?>
<%@ page errorPage="error.jap" %>
<%@ page contentType="text/xml" %>
<realmarid>
»ÊÂí»¨Ãû²á
<athlete>
<name>Æë´ïÄÚ</name>
<country> ......
»·¾³ÅäÖúú󣬿ª·¢JSP³ÌÐò¾Í·Ç³£¼òµ¥ÁË¡£
File-->New-->Web Project
Ôڸô°¿ÚÖÐÊäÈëһЩ¹¤³Ì»ù±¾ÐÅÏ¢£¬±ÈÈ繤³ÌÃû£¬ÕâÀïÊäÈëΪ test1-01
ÕâÑùÒ»¸ö»ùÓÚJSPµÄÏîÄ¿¾Í½¨Á¢ÆðÀ´ÁË¡£
Package Explorer µÄÏÔʾ·½·¨£º
Windows-->Show View-->Package Explorer ÕâÑù¾ÍÄÜÏÔʾ³öÀ´À²£¡
Ï ......
ÔÚ¸÷ÖÖSession ¹ÜÀí·½°¸ÖУ¬ ThreadLocal ģʽµÃµ½ÁË´óÁ¿Ê¹Óá£ThreadLocal ÊÇ
JavaÖÐÒ»ÖÖ½ÏΪÌØÊâµÄḬ̈߳󶨻úÖÆ¡£Í¨¹ýThreadLocal´æÈ¡µÄÊý¾Ý£¬×ÜÊÇÓ뵱ǰÏß³ÌÏà¹Ø£¬
Ò²¾ÍÊÇ˵£¬JVM Ϊÿ¸öÔËÐеÄỊ̈߳¬°ó¶¨ÁË˽Óеı¾µØʵÀý´æÈ¡¿Õ¼ä£¬´Ó¶øΪ¶àÏ̻߳·¾³³£³ö
ÏֵIJ¢·¢·ÃÎÊÎÊÌâÌṩÁËÒ»ÖÖ¸ôÀë»úÖÆ¡£
Ê×ÏÈ£¬ÎÒÃÇÐèÒªÖªµÀ£¬ ......