我想使用自定义taglib包含一个jsp文件。我已经完成了所有的taglib设置,但它显示了include语句而不是jsp内容。如何使用自定义taglib包含jsp文件?
public int doStartTag() throws JspException {
JspWriter out = pageContext.getOut();
StringBuffer sb = new StringBuffer();
if (section != null && !section.isEmpty()) {
sb.append("<%@ include file=\"defaultHeader.jsp\" %>");
}
try {
out.println(sb.toString());
} catch (IOException e) {
log.error("Failed to generate the tag", e);
e.printStackTrace();
}
return super.doStartTag();
我对taglibs真的很陌生,所以任何帮助表示赞赏。由于
谢谢,我只是想它出。 – stillLearning