title: How to throw exceptions for the init() method for servlets
body: <p>well I'll first show my code:</p>
  
  <pre><code>@Override
  public void init() throws ServletException {
      super.init();
  
      try {
          securityController = SecurityControllerFactory.getInstance().create();
      } catch (Exception e) {
          System.err.println("Error creating security controller; " + e.getMessage());
      }
  
      // max allowed uploaded uploadedFile size is 10 MB
      maxFileSize = getBytes(10);
      maxMemSize = getBytes(2);
  }
  </code></pre>
  
  <p>As you can see the compiler is forcing me to use try/catch for instantiating the SecurityController. In my case however I believe it should stop instantiating the Servlet and throw an exception in general if the security controller can't be instantiated. Any suggestions/explanations to this?</p>