docs: @SuppressWarnings("unchecked")
      @Override
      public void init() throws ServletException {
  
          ServletConfig config = getServletConfig();
  
  		// Load the context, if present...
  		try {
  	        
  			// Bootstrap the servlet Grammar instance...
          	final Grammar root = XmlGrammar.getMainGrammar();
  	        final InputStream inpt = CernunnosServlet.class.getResourceAsStream("servlet.grammar");	// Can't rely on classpath:// protocol handler...
              final Document doc = new SAXReader().read(inpt);
              final Task k = new ScriptRunner(root).compileTask(doc.getRootElement());
      		final RuntimeRequestResponse req = new RuntimeRequestResponse();
      		final ReturnValueImpl rslt = new ReturnValueImpl();
      		req.setAttribute(Attributes.RETURN_VALUE, rslt);
      		k.perform(req, new RuntimeRequestResponse());
      		Grammar g = (Grammar) rslt.getValue();
  	        runner = new ScriptRunner(g);
  
              // Choose a context location & load it if it exists...
              String defaultLoc = "/WEB-INF/" + config.getServletName() + "-portlet.xml";
              URL defaultUrl = getServletConfig().getServletContext().getResource(defaultLoc);
              URL u = Settings.locateContextConfig(
                      getServletConfig().getServletContext().getResource("/").toExternalForm(),
                          config.getInitParameter(CONFIG_LOCATION_PARAM), 
                          defaultUrl);
              if (u != null) {
                  // There *is* a resource mapped to this path name...
                  spring_context = new FileSystemXmlApplicationContext(u.toExternalForm());
              }
  			
  			if (log.isDebugEnabled()) {
  				log.debug("Location of spring context (null means none):  " + u);
  			}
  
  			// Load the Settings...
  			Map<String,String> settingsMap = new HashMap<String,String>();	// default...
  			if (spring_context != null && spring_context.containsBean("settings")) {
  				settingsMap = (Map<String,String>) spring_context.getBean("settings");
  			}
  			settings = Settings.load(settingsMap);
  
  		} catch (Throwable t) {
  			String msg = "Failure in CernunnosServlet.init()";
  			throw new ServletException(msg, t);
  		}
  
      }