一个jsp写的bbs
源代码在线查看: notetag.java
package com.laoer.bbscs.web.taglib;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
import org.apache.struts.taglib.TagUtils;
import com.laoer.bbscs.bean.Note;
/**
* Title: Tianyi BBS
*
* Description: BBSCS
*
* Copyright: Copyright (c) 2006
*
* Company: Laoer.com
*
* @author Gong Tianyi
* @version 7.0
*/
public class NoteTag
extends TagSupport {
protected String name = "";
protected String property = null;
protected String scope = null;
public NoteTag() {
}
public int doStartTag() throws JspException {
return (SKIP_BODY);
}
public int doEndTag() throws JspException {
//Note note;
Object value = TagUtils.getInstance().lookup(pageContext, name, property, scope);
if (value == null) {
return (SKIP_BODY);
}
int isNew = ( (Integer) value).intValue();
StringBuffer sb = new StringBuffer();
if (isNew == 0) {
sb.append("");
}
if (isNew == 1) {
sb.append("");
}
//if (isNew == 2) {
//sb.append("");
//}
TagUtils.getInstance().write(pageContext, sb.toString());
return (SKIP_BODY);
}
public String getName() {
return name;
}
public String getProperty() {
return property;
}
public String getScope() {
return scope;
}
public void setName(String name) {
this.name = name;
}
public void setProperty(String property) {
this.property = property;
}
public void setScope(String scope) {
this.scope = scope;
}
}