i have created Standalone application in spring. for exception handling i am using custom exception handler which extends SimpleMappingExceptionResolver class.
whenever exception occurs in program i want to delegate it to specific java method. how do i do that ?
i saw lots of examples on the net, but everywhere exception handling done on .jsp page. how i catch the exception in java method.
here is my bean config file
<bean class="com.ys.core.exception.ExceptionHandler">
<property name="exceptionMappings">
<props>
<prop key="com.ys.core.exception.MyException">ExceptionHandler</prop>
<prop key="java.lang.Exception">ExceptionHandler</prop>
<prop key="java.lang.ArithmeticException">ExceptionHandler</prop>
</props>
</property>
</bean>
<bean id="exceptionHandler" class="com.ys.core.exception.ExceptionHandler" />
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/com/ys/core/service/myservices" />
<property name="suffix" value=".java" />
</bean>
can i do like this ? means call .java class instead of jsp file ?