⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 softlisttag.java

📁 简介: 功能介绍: 1:多用户统计系统
💻 JAVA
字号:
package org.jetic.web.soft;import org.jetic.util.Format;import org.jetic.web.*;/** * Title:        经天科技 * Description: * Copyright:    Copyright (c) 2001 * Company:      www.jetic.org 经天 * @author hover * @version 1.0 */public class SoftListTag extends TagBase {    private Soft soft = new Soft();    private Pagination pagin;    private int groupID = 0;    private int categoryID = 0;    private String keyword = "";    private int pagesize = 0;    private int page = 1;    public SoftListTag() {        super();        setChildTag(this);        setDbo(soft);    }    public void init() {        String condition = "";        if (pagesize > 0)            pagin = new Pagination(pagesize);        else            pagin = new Pagination();        pagin.setTable(soft.getTable());        pagin.setDirection(false);        pagin.setFields(soft.getDataFields());        pagin.setPage(page);        if (categoryID > 0) {            condition = "category = " + categoryID;        }        else if (groupID > 0) {            condition = "groups = " + groupID;        }        if (keyword.length() > 0) {            String search = "[name] LIKE '%" + Format.toSql(keyword) +                    "%' OR intro LIKE '%" + Format.toSql(keyword) + "%'";            if (condition.length() > 0)                condition += " AND (" + search + ")";            else                condition += search;        }        if (condition.length() > 0) pagin.setCondition(condition);        try {            DBConnect conn = new DBConnect();            pagin.setStmt(conn.getStatement());            String sql = pagin.getSql();            rs = conn.executeQuery(sql);        }        catch (Exception ex) {            ex.printStackTrace(System.err);        }    }    public void destroy() {        pageContext.setAttribute("listpage", new Integer(pagin.getPage()));        pageContext.setAttribute("listpagecount", new Integer(pagin.getPagecount()));    }    public void writeBody() {        super.writeBody();    }    public int getGroupID() {        return groupID;    }    public void setGroupID(int newGroupID) {        groupID = newGroupID;    }    public void setCategoryID(int newCategoryID) {        categoryID = newCategoryID;    }    public int getCategoryID() {        return categoryID;    }    public void setKeyword(String newKeyword) {        keyword = newKeyword;    }    public String getKeyword() {        return keyword;    }    public void setPagesize(int newPagesize) {        pagesize = newPagesize;    }    public int getPagesize() {        return pagesize;    }    public void setPage(int newPage) {        page = newPage;    }    public int getPage() {        return page;    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -