재담이의 끄적끄적

  • 홈
  • 태그
  • 방명록

@ResponseStatus 1

[Spring] 스프링 MVC(11) - @ExceptionHandler, @ControllerAdvice, @ResponseStatus 어노테이션

@ExceptionHandler 어노테이션을 이용한 예외 처리 컨트롤러의 @RequestMapping 메서드를 실행하는 과정에서 예외가 발생할 때 직접 예외 처리를 하고 싶다면, @ExceptionHandler 어노테이션을 사용하면 된다. 다음 코드를 보자. @Controller public class CalculationController { @RequestMapping("/cal/divide") public String divide(Model model, @RequestParam("op1") int op1, @RequestParam("op2") int op2) { model.addAttribute("result", op1 / op2); return "cal/result"; } @ExceptionHan..

Spring 2022.03.16
이전
1
다음
더보기
  • 분류 전체보기 (156)
    • Spring (43)
    • Java (14)
    • 알고리즘 (72)
      • BOJ (67)
      • 프로그래머스 (4)
    • 보안 (2)
    • 객체지향 (11)
    • 웹개발 (5)
    • 운영체제 (4)
    • 데이터베이스 (3)
    • 네트워크 (2)
    • 수학 (0)

Tag

SpringMVC, 디자인패턴, bean, 자바, SpringDB, 정렬, boj, Spring, 스프링, DP, 객체지향, 알고리즘, 백준, 스프링MVC, 빈, BFS, C++, AOP, 스택, java,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2026/01   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

티스토리툴바