@Override public void init(ServletConfig config) throws ServletException { super.init(config); OntModel displayOntModel = (OntModel) config.getServletContext().getAttribute("displayOntModel"); this.urlPatterns = new NavigationURLPatternListener(); displayOntModel.getBaseModel().register(urlPatterns); }
/** * When initialized, get a reference to the File Storage system. Without that, we can do nothing. */ @Override public void init() throws ServletException { super.init(); Object o = getServletContext().getAttribute(FileStorageSetup.ATTRIBUTE_NAME); if (o instanceof FileStorage) { fileStorage = (FileStorage) o; } else if (o == null) { throw new UnavailableException( this.getClass().getSimpleName() + " could not initialize. Attribute '" + FileStorageSetup.ATTRIBUTE_NAME + "' was not set in the servlet context."); } else { throw new UnavailableException( this.getClass().getSimpleName() + " could not initialize. Attribute '" + FileStorageSetup.ATTRIBUTE_NAME + "' in the servlet context contained an instance of '" + o.getClass().getName() + "' instead of '" + FileStorage.class.getName() + "'"); } }