qualle
Dec 7th, 2007, 04:11 AM
Hallo, I'm using:
<bean id="exceptionResolver" class="org.springframework.web.servlet.handler.Sim pleMappingExceptionResolver">
<property name="exceptionMappings">
<props>
<prop key="java.lang.Exception">ID_Exception</prop>
</props>
</property>
</bean>
and
<bean id="ID_Exception" class="....MY_Exception" />
and my Controller shows as:
public class MY_Exception implements HandlerExceptionResolver{
public ModelAndView resolveException (
HttpServletRequest request,
HttpServletResponse response,
Object handler,
Exception ex )
{ ..... }
}
Is there any way to find the Error code of an Exception. For example 404, 500 etc ... I get a null when I use ex.getMessage() ?:(
<bean id="exceptionResolver" class="org.springframework.web.servlet.handler.Sim pleMappingExceptionResolver">
<property name="exceptionMappings">
<props>
<prop key="java.lang.Exception">ID_Exception</prop>
</props>
</property>
</bean>
and
<bean id="ID_Exception" class="....MY_Exception" />
and my Controller shows as:
public class MY_Exception implements HandlerExceptionResolver{
public ModelAndView resolveException (
HttpServletRequest request,
HttpServletResponse response,
Object handler,
Exception ex )
{ ..... }
}
Is there any way to find the Error code of an Exception. For example 404, 500 etc ... I get a null when I use ex.getMessage() ?:(