カスタムタグについてのデモをコーディングしようとしていますが、この問題は..嫌いです。自分で解決できます。
これが私の.TLDファイルです:
<tag>
<name>custom</name>
<tagclass>MyTag.CustomerTag</tagclass>
<bodycontent>empty</bodycontent>
</tag>
そして、これが私のクラスCustomerTagです。
public class CustomerTag extends TagSupport {
private PageContext _pageContext;
@Override
public int doStartTag() throws JspException {
try {
_pageContext.getOut().println("kakaka"); <-- **here cause exception**
} catch (IOException ex) {
JOptionPane.showMessageDialog(null, ex.getMessage());
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, ex.getMessage());
}
return SKIP_BODY;
}
@Override
public int doEndTag() throws JspException {
return SKIP_PAGE;
}
}
これが私のJSPファイルです。
<%@taglib uri="/WEB-INF/Marko.tld" prefix="myTag" %>
<myTag:custom />
助けてください、みんなありがとう