Spring Exception Handeling Production vs Development

Viewed 555

I am using Spring MVC and I am handling the Exception in the first way described here: http://www.javacodegeeks.com/2013/06/spring-mvc-error-handling-flow.html

which is basically putting the following code in web.xml

<error-page>
    <exception-type>java.lang.Exception</exception-type>
    <location>/uncaughtException</location>
</error-page> 

Now, I need to make 2 types of views for production and development. For development, I will print the full stacktrace, for production, I would say something like: "Something bad happens, please try again later". I need suggestions to differentiate between production and development. I am using apache maven to compile and there is a flag "-Dbuild.type=dev" which says that it is a dev compilation.

Any help will be appreciated, Thanks.

2 Answers
Related