Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 1222 → Rev 1223

/hostadmiral/branches/hibernate3/src/ak/hostadmiral/core/taglib/list/ExistTagBase.java
0,0 → 1,64
package ak.hostadmiral.core.taglib.list;
 
import javax.servlet.http.HttpServletRequest;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;
import org.apache.struts.util.RequestUtils;
import ak.hostadmiral.util.CollectionInfo;
 
public abstract class ExistTagBase
extends TagSupport
{
protected String infoBean = null;
 
public String getInfoBean()
{
return this.infoBean;
}
 
public void setInfoBean(String infoBean)
{
this.infoBean = infoBean;
}
 
protected String infoProperty = null;
 
public String getInfoProperty()
{
return this.infoProperty;
}
 
public void setInfoProperty(String infoProperty)
{
this.infoProperty = infoProperty;
}
 
public int doStartTag() throws JspException
{
if(condition())
return EVAL_BODY_INCLUDE;
else
return SKIP_BODY;
}
 
public int doEndTag() throws JspException
{
return EVAL_PAGE;
}
 
protected abstract boolean condition() throws JspException;
 
protected CollectionInfo getCollectionInfo()
throws JspException
{
return (CollectionInfo)
RequestUtils.lookup(pageContext, infoBean, infoProperty, null);
}
 
public void release()
{
super.release();
infoBean = null;
infoProperty = null;
}
}