1 16 package dlog4j.formbean; 17 18 import java.util.Date ; 19 20 import javax.servlet.http.HttpServletRequest ; 21 22 23 import org.apache.struts.action.ActionErrors; 24 import org.apache.struts.action.ActionMapping; 25 26 import dlog4j.util.HtmlUtil; 27 28 36 public class ReplyForm extends ContentPreviewForm { 37 38 40 41 private String faceUrl; 42 43 44 private Date writeTime; 45 46 47 private int id; 48 49 50 private LogForm log; 51 52 53 private UserForm author; 54 55 private SiteForm site; 56 57 int useFace = 1; 58 int useUbb = 1; 59 int showFormerly = 0; 60 62 68 public ActionErrors validate( 69 ActionMapping mapping, 70 HttpServletRequest request) { 71 ActionErrors errors = new ActionErrors(); 72 return errors; 73 } 74 75 public void reset(ActionMapping mapping, HttpServletRequest req) { 76 writeTime = null; 77 faceUrl = null; 78 useFace = 1; 79 useUbb = 1; 80 showFormerly = 0; 81 content = null; 82 } 83 87 public String getFaceUrl() { 88 return faceUrl; 89 } 90 91 95 public void setFaceUrl(String faceUrl) { 96 this.faceUrl = faceUrl; 97 } 98 99 public static void main(String [] args) { 100 ReplyForm r = new ReplyForm(); 101 r.setContent("<FONT style=\"BACKGROUND-COLOR: #ffccff\" color=#660033><TABLE cellSpacing=1 cellPadding=2 width=\"100%\" border=1><TBODY><TR><TD></TD><TD></TD><TD></TD></TR><TR><TD></TD><TD></TD><TD></TD></TR><TR><TD></TD><TD></TD><TD></TD></TR><TR><TD></TD><TD></TD><TD></TD></TR></TBODY></TABLE><BR>现在要搞评论的修改了!</FONT> "); 102 System.out.print(r.getBrief()); 103 } 104 105 public String getHtmlContent(){ 106 return HtmlUtil.makeHtml(content, useFace==1, useUbb==1); 107 } 108 109 113 public Date getWriteTime() { 114 return writeTime; 115 } 116 120 public void setWriteTime(Date writeTime) { 121 this.writeTime = writeTime; 122 } 123 124 128 public int getId() { 129 return id; 130 } 131 132 136 public void setId(int id) { 137 this.id = id; 138 } 139 public int getAuthorId() { 140 return author.getId(); 141 } 142 public void setAuthorId(int aid) { 143 if (author == null) 144 author = new UserForm(); 145 author.setId(aid); 146 } 147 public String getAuthorName() { 148 return author.getDisplayName(); 149 } 150 153 public UserForm getAuthor() { 154 return author; 155 } 156 157 160 public void setAuthor(UserForm form) { 161 author = form; 162 } 163 164 167 public LogForm getLog() { 168 return log; 169 } 170 171 174 public void setLog(LogForm form) { 175 log = form; 176 } 177 178 181 public int getLogId() { 182 return log.getId(); 183 } 184 185 188 public void setLogId(int logid) { 189 if (log == null) 190 log = new LogForm(); 191 log.setId(logid); 192 } 193 194 197 public int getUseFace() { 198 return useFace; 199 } 200 201 204 public int getUseUbb() { 205 return useUbb; 206 } 207 208 211 public void setUseFace(int i) { 212 useFace = i; 213 } 214 215 218 public void setUseUbb(int i) { 219 useUbb = i; 220 } 221 222 225 public int getShowFormerly() { 226 return showFormerly; 227 } 228 229 232 public void setShowFormerly(int i) { 233 showFormerly = i; 234 } 235 236 239 public SiteForm getSite() { 240 return site; 241 } 242 243 246 public void setSite(SiteForm form) { 247 site = form; 248 } 249 250 } 251 | Popular Tags |