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

📄 articlelisttag.java

📁 系统简介:用JSP开发的网校系统 谢谢使用
💻 JAVA
字号:
package org.jetic.web.tech;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 ArticleListTag extends TagBase {    private Article article = new Article();    private Pagination pagin;    private int categoryID =0;    private int page = 1;    private int pagesize = 15;    private String keyword = "";    public ArticleListTag() {        super();        setChildTag(this);        setDbo(article);    }    public void init() {        String condition = "";        if (pagesize > 0)            pagin = new Pagination(pagesize);        else            pagin = new Pagination();        pagin.setTable(article.getTable());        pagin.setDirection(false);        pagin.setFields(article.getDataFields());        pagin.setPage(page);        if (categoryID > 0) condition = "fdiCategory = " + categoryID;        if (keyword.length() > 0) {            String validKeyword = Format.toSql(keyword);            String search =                "fdcTitle LIKE '%" + validKeyword + "%' OR " +                "fdcAuthor LIKE '%" + validKeyword + "%' OR " +                "fdcContent LIKE '%" + validKeyword + "%'";            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 int getCategoryID() {        return categoryID;    }    public void setCategoryID(int newCategoryID) {        categoryID = newCategoryID;    }    public void setPage(int newPage) {        page = newPage;    }    public int getPage() {        return page;    }    public void setPagesize(int newPagesize) {        pagesize = newPagesize;    }    public int getPagesize() {        return pagesize;    }    public void setKeyword(String newKeyword) {        keyword = newKeyword;    }    public String getKeyword() {        return keyword;    }}

⌨️ 快捷键说明

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