public int doEndTag() throws JspException {
try {
StringBuffer results = new StringBuffer("");
if ("SEX".equals(collection)) {
results.append("<option value=\"0\" selected=\"selected\">请选择</option>");
results.append("<option value=\"1\">男</option>");
results.append("<option value=\"2\">女</option>");
}
pageContext.getOut().write(results.toString());
} catch (IOException ex) {
throw new JspTagException("错误");
}
return EVAL_PAGE;
}
// collection只是传递一个标识,具体下拉值内容是从数据库取还是从请求中得到为不同具体实现
protected String collection;
public String getCollection() {
return collection;
}
public void setCollection(String collection) {