title: How to log and view the messages caught by try-catch block in Servlets?
body: <p>Here is my try-catch block:</p>
  
  <pre><code>try {
      return dbConnection.createStatement();
  } catch(SQLException sqle) {
      // TODO SQL Exception
      System.out.println(sqle.getMessage());
  }
  </code></pre>
  
  <p>Is it correct to use <code>System.out</code> object in Servlets?</p>
  
  <p>What is the easiest way for debugging purposes?</p>
  
  <p>I wanted the message to be printed in the error page generated by the server, eg: <code>HTTP Status 500</code>.</p>