title: Handling 404 error in Servlet
body: <p>I am trying to redirect to different error jsp base on status code </p>
  
  <p><code>statusCode = (Integer) req.getAttribute("javax.servlet.error.status_code")
  </code>
  but it is throwing a null pointer error.
  My web.xml is look like </p>
  
  <pre><code>&lt;exception-type&gt;404&lt;/exception-type&gt;&lt;location&gt;/AppExceptionHandler&lt;/location&gt;
  </code></pre>