package com.huawei.common.util;
import java.io.IOException;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.BodyTagSupport;
import javax.servlet.jsp.tagext.Tag;
import javax.servlet.jsp.tagext.TagSupport;
public class CommonMenu extends TagSupport {
String beanUrl;// 存放类的路径
String actionUrl;// action 的url
String attrVoName;// action 中vo的名字
String fieldType;// 这个属性主要是解决一个表的属性是由哪个表的字段选择而来格式:ownFiled1:otherTable1.filed1;
String add = "true";
String delete = "true";
String edit = "true";
String query = "true";
String export = "true";
public int doStartTag() {
JspWriter jw = this.pageContext.getOut();
try {
jw.write("<table border=1>");
jw.write("<tr>");
if (add.equalsIgnoreCase("true"))
jw
.write("<input type='button' onClick=/"submitPubOper('add')/" value='add'> ");
if (delete.equalsIgnoreCase("true"))
jw
.write("<input type='button' onClick=/"alert('delete')/" value='delete'> ");
if (edit.equalsIgnoreCase("true"))
jw
.write("<input type='button' onClick=/"alert('edit')/" value='edit'> ");
if (query.equalsIgnoreCase("true"))
jw
.write("<input type='button' onClick=/"alert('query')/" value='query'> ");
if (export.equalsIgnoreCase("true"))
jw
.write("<input type='button' onClick=/"alert('export')/" value='export'> ");
jw.write("</tr>");
jw.write("</table>");
jw.write("<br/>");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return Tag.SKIP_BODY;
}
/*
* public int doEndTag() throws JspException { return Tag.EVAL_PAGE; }
*/
public void setActionUrl(String actionUrl) {
this.actionUrl = actionUrl;
}
public void setAttrVoName(String attrVoName) {
this.attrVoName = attrVoName;
}
public void setAdd(String add) {
this.add = add;
}
public void setDelete(String delete) {
this.delete = delete;
}
public void setEdit(String edit) {
this.edit = edit;
}
public void setQuery(String query) {
this.query = query;
}
public void setExport(String export) {
this.export = export;
}
public void setBeanUrl(String beanUrl) {
this.beanUrl = beanUrl;
}
public void setFieldType(String fieldType) {
this.fieldType = fieldType;
}
}
CommonMenu.java
最新推荐文章于 2023-05-17 16:14:25 发布