org.springframework.web.servlet.NoHandlerFoundException#getMessage ( )源码实例Demo

下面列出了org.springframework.web.servlet.NoHandlerFoundException#getMessage ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: Spring-Boot-Book   文件: GlobalExceptionHandler.java
/**
 * 404 - Not Found
 */
@ResponseStatus(HttpStatus.NOT_FOUND)
@ExceptionHandler(NoHandlerFoundException.class)
public String noHandlerFoundException(NoHandlerFoundException e, Model model) {
    logger.error("Not Found", e);
    String message = "【页面不存在】" + e.getMessage();
    model.addAttribute("message", message);
    model.addAttribute("code", 404);
    System.out.println("404404错误");
    return viewName;
}
 
源代码2 项目: Spring-Boot-Book   文件: GlobalExceptionHandler.java
/**
 * 404 - Not Found
 */
@ResponseStatus(HttpStatus.NOT_FOUND)
@ExceptionHandler(NoHandlerFoundException.class)
public String noHandlerFoundException(NoHandlerFoundException e, Model model) {
    logger.error("Not Found", e);
    String message = "【页面不存在】" + e.getMessage();
    model.addAttribute("message", message);
    model.addAttribute("code", 404);
    System.out.println("404404错误");
    return viewName;
}
 
源代码3 项目: SENS   文件: GlobalExceptionHandler.java
/**
 * 404 - Not Found
 */
@ResponseStatus(HttpStatus.NOT_FOUND)
@ExceptionHandler(NoHandlerFoundException.class)
public String noHandlerFoundException(NoHandlerFoundException e, Model model) {
    log.error("Not Found", e);
    String message = "【页面不存在】" + e.getMessage();
    model.addAttribute("message", message);
    model.addAttribute("code", 404);
    return viewName;
}
 
源代码4 项目: ProjectStudy   文件: ExceptionAdvice.java
/**
 * 捕捉404异常
 * @return
 */
@ResponseStatus(HttpStatus.NOT_FOUND)
@ExceptionHandler(NoHandlerFoundException.class)
public ResponseBean handle(NoHandlerFoundException e) {
    return new ResponseBean(HttpStatus.NOT_FOUND.value(), e.getMessage(), null);
}
 
源代码5 项目: ProjectStudy   文件: ExceptionAdvice.java
/**
 * 捕捉404异常
 * @return
 */
@ResponseStatus(HttpStatus.NOT_FOUND)
@ExceptionHandler(NoHandlerFoundException.class)
public ResponseBean handle(NoHandlerFoundException e) {
    return new ResponseBean(HttpStatus.NOT_FOUND.value(), e.getMessage(), null);
}
 
源代码6 项目: ProjectStudy   文件: ExceptionAdvice.java
/**
 * 捕捉404异常
 * @return
 */
@ResponseStatus(HttpStatus.NOT_FOUND)
@ExceptionHandler(NoHandlerFoundException.class)
public ResponseBean handle(NoHandlerFoundException e) {
    return new ResponseBean(HttpStatus.NOT_FOUND.value(), e.getMessage(), null);
}
 
源代码7 项目: ShiroJwt   文件: ExceptionAdvice.java
/**
 * 捕捉404异常
 * @return
 */
@ResponseStatus(HttpStatus.NOT_FOUND)
@ExceptionHandler(NoHandlerFoundException.class)
public ResponseBean handle(NoHandlerFoundException e) {
    return new ResponseBean(HttpStatus.NOT_FOUND.value(), e.getMessage(), null);
}