Spring Level 3 예외 처리

song yuheon·2023년 9월 2일
0

Spring

목록 보기
39/93
post-thumbnail
post-custom-banner

AuthFilter


HttpServletResponse httpServletResponse = (HttpServletResponse) response;
httpServletResponse.setContentType("text/html; charset=UTF-8");
PrintWriter writer;

httpServletResponse.setStatus(400);
writer= httpServletResponse.getWriter();

writer.println("{\n   \"status\":\"400\", ");
writer.println("   \"message\":\"토큰이 유효하지 않습니다 >.< !!! \"\n}");
writer.flush();
return;

Question

Question PrintWriter를 통한 Filter에서의 예외 처리


profile
backend_Devloper
post-custom-banner

0개의 댓글