📄 paramtag.java
字号:
package com.trulytech.mantis.tag;
import javax.servlet.jsp.tagext.TagSupport;
import java.io.IOException;
import javax.servlet.jsp.JspTagException;
import com.trulytech.mantis.result.DBResult;
/************************************
<bean:param name="Result" property="msg" />
***********************************************/
/**
* <p>Title: Mantis</p>
*
* <p>Description: 获得DBResult查询参数的值</p>
*
* <p>Copyright: Copyright (c) 2002</p>
*
* <p>Company: </p>
*
* @author Wang Xian
* @version 1.0
*/
public class ParamTag
extends TagSupport {
private String Name = null;
private String Property = null;
/**
* 覆盖doStartTag方法
* @return int
* @throws JspTagException
*/
public int doStartTag() throws JspTagException {
return EVAL_BODY_INCLUDE;
}
public int doEndTag() throws JspTagException {
try {
if (this.pageContext.findAttribute(Name) != null)
if (this.pageContext.findAttribute(Name) instanceof DBResult) {
if ( ( (DBResult)this.pageContext.findAttribute(Name)).ParamList.get(
Property) == null)
this.pageContext.getOut().write("");
else
this.pageContext.getOut().write( (String) ( (DBResult)this.
pageContext.findAttribute(Name)).ParamList.get(Property));
}
else
this.pageContext.getOut().write("");
else
this.pageContext.getOut().write("");
}
catch (IOException e) {
throw new JspTagException("Fatal error");
}
return EVAL_PAGE;
}
public void setName(String Name) {
this.Name = Name;
}
public void setProperty(String Property) {
this.Property = Property;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -