私が持っている JSP TagLib クラスの共通クラスを構築しようとしています。
class MyTag extends CustomTag
{
public int doEndTag()
{
JspWriter out = pageContext.getOut(); <-- this one works fine
}
}
class CustomTag extends BodyTagSupport
{
public CustomTag()
{
JspWriter out = pageContext.getOut(); <-- this one throws me a Nullpointer
}
}
私は何を間違っていますか?
親に追加のメソッドを作成し、それを doEndTag() から子から呼び出すこともできますが、コンストラクターを使用する方がはるかに優れています。