0,0 → 1,50 |
// based on struts write tag |
package ak.hostadmiral.core.taglib; |
|
import javax.servlet.jsp.JspException; |
import org.apache.struts.util.RequestUtils; |
import org.apache.struts.util.ResponseUtils; |
|
public class WriteTag |
extends org.apache.struts.taglib.bean.WriteTag |
{ |
protected String defValue; |
|
public String getDefault() |
{ |
return defValue; |
} |
|
public void setDefault(String defValue) |
{ |
this.defValue = defValue; |
} |
|
public int doStartTag() |
throws JspException |
{ |
Object value; |
|
if(ignore && RequestUtils.lookup(pageContext, name, scope) == null) |
value = null; |
else |
value = RequestUtils.lookup(pageContext, name, property, scope); |
|
if(value == null) value = defValue; |
|
if(value != null) { |
if(filter) |
ResponseUtils.write(pageContext, ResponseUtils.filter(formatValue(value))); |
else |
ResponseUtils.write(pageContext, formatValue(value)); |
} |
|
return SKIP_BODY; |
} |
|
public void release() |
{ |
super.release(); |
defValue = null; |
} |
} |