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

📄 forward.java

📁 Jsp实现的简单的论坛管理系统,对学习Jsp+Servlet+JavaBean很有帮助
💻 JAVA
字号:
package org.jetic.web.notepad;/** * Title:        经天网络 * Description: * Copyright:    Copyright (c) 2000<br> * Company:      www.jetic.com  经天<br> * @author hover * @version 1.0 */import java.sql.ResultSet;import org.jetic.util.*;public class Forward {    private int noteid = 1;    private String subject = "";    private String to = "";    private String body = "";    public void setNoteid(int noteid)       { this.noteid = noteid; }    public int getNoteid()                  { return this.noteid; }    public void setSubject(String subject) {        this.subject = Charset.NetworkToLocal(subject);    }    public String getSubject() {        getNoteDetail();        return Charset.LocalToNetwork(subject);    }    public void setTo(String to)            { this.to = Charset.NetworkToLocal(to); }    public String getTo()                   { return Charset.LocalToNetwork(to); }    public void setBody(String body)        { this.body = Charset.NetworkToLocal(body); }    public String getBody()                 { return Charset.LocalToNetwork(body); }    public void getNoteDetail() {        DBConnect db = null;        ResultSet rs = null;        try {            db = new DBConnect("select * from tbNotepad where ID = ?");            db.setInt(1, noteid);            rs = db.executeQuery();            if (rs.next()) {                if (this.subject.equals("") || this.subject == null)                    this.subject = "转寄:" + Charset.DatabaseToLocal(rs.getString("fdcCaption"));                this.body = Charset.DatabaseToLocal(rs.getString("fdcContent")) +                    "\n\n--\n" +                    "※ 来源: hover 的记事本 http://202.115.4.235/notepad";            }        }        catch (Exception ex) {            System.err.print("错误 (Forward.Forward()):");            ex.printStackTrace(System.err);        }        finally {            try {db.close();}   catch (Exception ex) {}        }    }    public boolean Check() {        return !(            subject.equals("") || subject == null ||            to.equals("") || to == null);    }    public void Send() {        Sendmail mail = null;        getNoteDetail();        try {            mail = new Sendmail();            mail.setTo(this.to);            mail.setSubject(this.subject);            mail.setBody(this.body);            mail.send();        }        catch (Exception ex) {            System.err.print("错误 (Forward.Send()):");            ex.printStackTrace(System.err);        }    }}

⌨️ 快捷键说明

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