java - Spring MVC 3 User Defined Exception handling with User defined View -


how handle user defined exceptions (custom exception ex.: "businessexception") in spring mvc 3 custom message , view name ?

for example :

if throw own exception service layer should caught , should redirect specified view message, view name may same or different.

and want display message using properties file searched in google, no luck.

thanks.

have @ simplemappingexceptionresolver

<bean     class="org.springframework.web.servlet.handler.simplemappingexceptionresolver">     <property name="exceptionmappings">         <props>             <prop key="com.example.exception.businessexception">                 yourview                     </prop>             <prop key="java.lang.exception">error</prop>         </props>     </property> </bean> 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -