private Page notFound ( final HttpServletResponse response , final SecurityContext securityContext ) throws IOException , FrameworkException { final List < Page > errorPages = StructrApp . getInstance ( securityContext ) . nodeQuery ( Page . class ) . and ( StructrApp . key ( Page . class , "showOnErrorCodes" ) , "404" , false ) . getAsList ( ) ; for ( final Page errorPage : errorPages ) { if ( isVisibleForSite ( securityContext . getRequest ( ) , errorPage ) ) { response . setStatus ( HttpServletResponse . SC_NOT_FOUND ) ; return errorPage ; } } response . sendError ( HttpServletResponse . SC_NOT_FOUND ) ; return null ; }
Handle 404 Not Found