title: Handle Exception in Jsp
body: <p>Good Afternoon in my timezone.</p>
  
  <p>I am using struts framework in my Web App development.
  I had parametrize the exception handling in the struts-config.xml file :</p>
  
  <pre><code>&lt;global-exceptions&gt;
      &lt;exception key="sap-error" type="com.galpenergia.sgt.util.excepcoes.chained.user.UserException" path="/globalError.jsp"/&gt;
      &lt;exception key="global-error" type="java.lang.Exception" path="/globalError.jsp"/&gt;
  &lt;/global-exceptions&gt;
  </code></pre>
  
  <p>And in the globalError jsp i have the following page directive</p>
  
  <pre><code>&lt;%@page isErrorPage="true" %&gt;
  </code></pre>
  
  <p>When i try to get the message from the exception object , it tells me that the exception object is null.</p>
  
  <pre><code>&lt;% if(exception != null) {%&gt;
      &lt;%=exception.getMessage() %&gt;
  &lt;%}else{ %&gt;
  &lt;p&gt;Exception object is null&lt;/p&gt;
  &lt;% }%&gt;
  </code></pre>
  
  <p>Why is this happening ?</p>
  
  <p>Thanks in advance.
  Best regrads</p>