'PageContext' object is not available during ClassicHandler Object creation. Container sets the PageContext Object after object creation. Please see the LifeCycle steps. At this stage 'pageContext' object points to 'null', calling getOut() on it throws 'NullPointerException'.
Declare like this,
and get 'JspWriter' object in doStartTag() method like,
Since PageContext object is available in doStartTag().