title: How to Properly Handle Exceptions in a JSP/Servlet App?
body: <p>How do you properly handle errors encountered in a servlet? Right now, the app that I inherited (uses only plain JSP/Servlet) has a superclass called <code>Controller</code> which extends <code>HttpServlet</code> and which all other servlets extend from. In that <code>Controller</code> class is a try and catch block like the following:</p>
  
  <pre><code>try {
      // execute doPost or doGet here
  } catch (Exception e) {
      // show a generic error page
  }
  </code></pre>
  
  <p>Is this the proper way of doing it? It seems clunky and doesn't seem to always work. I'm only an intern so I don't have a lot of experience with this. Any advice? I'm trying to make the app for robust..</p>