protected PageContext getPageContext ( ) { JspContext ctxt = getJspContext ( ) ; if ( ctxt instanceof PageContext ) return ( PageContext ) ctxt ; // assert the page context and log an error in production assert ( false ) : "The JspContext was not a PageContext" ; logger . error ( "The JspContext was not a PageContext" ) ; return null ; }
This method will attempt to cast the JspContext into a PageContext . If this fails it will log an exception .