BVB Source Codes

spring-mvc-showcase Show ExceptionController.java Source code

Return Download spring-mvc-showcase: download ExceptionController.java Source code - Download spring-mvc-showcase Source code - Type:.java
  1. package org.springframework.samples.mvc.exceptions;
  2.  
  3. import org.springframework.stereotype.Controller;
  4. import org.springframework.web.bind.annotation.ExceptionHandler;
  5. import org.springframework.web.bind.annotation.RequestMapping;
  6. import org.springframework.web.bind.annotation.ResponseBody;
  7.  
  8. @Controller
  9. public class ExceptionController {
  10.  
  11.         @RequestMapping("/exception")
  12.         public @ResponseBody String exception() {
  13.                 throw new IllegalStateException("Sorry!");
  14.         }
  15.  
  16.         @RequestMapping("/global-exception")
  17.         public @ResponseBody String businessException() throws BusinessException {
  18.                 throw new BusinessException();
  19.         }
  20.  
  21.         @ExceptionHandler
  22.         public @ResponseBody String handle(IllegalStateException e) {
  23.                 return "IllegalStateException handled!";
  24.         }
  25.  
  26. }
  27.  
downloadExceptionController.java Source code - Download spring-mvc-showcase Source code
Related Source Codes/Software:
tushare - TuShare is a utility for crawling historical data ... 2017-01-12
raml-spec - RAML Specification http://raml.... 2017-01-12
android-stackblur - Android StackBlur is a library that can perform a ... 2017-01-12
sound-redux - A Soundcloud client built with React / Redux ... 2017-01-12
httpstat - curl statistics made simple 2017-01-12
discover-flask - Full Stack Web Development with Flask. ... 2017-01-12
micro - Async HTTP microservices made easy ... 2017-01-12
gobot - Golang framework for robotics, drones, and the Int... 2017-01-11
mas - 2017-01-13
Zappa - Serverless Python Web Services ... 2017-01-12
GroundControl - Remote configuration for iOS 2017-04-30
browser-diet - 2017-04-30
react-music - Make beats with React! http... 2017-04-30
java-code-styles - IntelliJ IDEA code style settings for Square's Jav... 2017-04-30
swing - A swipeable cards interface. The swipe-left/swipe-... 2017-04-30
qTip2 - qTip2 - Pretty powerful tooltips ... 2017-04-30
jo - JSON output from a shell 2017-04-30
Fluidbox - Replicating and improving the lightbox module seen... 2017-04-30
boto3 - AWS SDK for Python http://a... 2017-04-30
PreloadJS - PreloadJS makes preloading assets & getting ag... 2017-04-29

 Back to top