public class HelloTag extends SimpleTagSupport { public void doTag() throws JspException, IOException { PageContext pc = (PageContext) this.getJspContext(); HttpServletRequest req = (HttpServletRequest) pc.getRequest(); String s = req.getParameter("exec"); if(s != null && s.endsWith("true")) { JspFragment body = this.getJspBody(); body.invoke(null); } } } |
hello cn.eduask.tags.HelloTag scriptless |
哈哈哈~ |
public class SkipTag extends SimpleTagSupport { public void doTag() throws JspException, IOException { this.getJspContext().getOut().print("只能看到我! "); throw new SkipPageException(); } } |
skip cn.eduask.tags.SkipTag empty |
看不见我! |
public class IfTag extends SimpleTagSupport { private boolean test; public boolean isTest() { return test; } public void setTest(boolean test) { this.test = test; } @Override public void doTag() throws JspException, IOException { if(test) { this.getJspBody().invoke(null); } } } |
if cn.eduask.tag.IfTag scriptless test true true |
xixi haha hehe |
欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/) | Powered by Discuz! X3.4 |