inflearn logo
Khóa học

Khóa học

Chia sẻ kiến thức

Bài viết của goodjobs

goodjobs goodjobs

@goodjobs

Số lượng đánh giá đã viết
2
Xếp hạng trung bình
5.0

Bài viết 1

Hỏi & Đáp

sendError부분과 setStatus이 차이가 아직 잘이해가 되지않습니다.

@Controller @RequestMapping({"${server.error.path:${error.path:/error}}"}) public class BasicErrorController extends AbstractErrorController { public ModelAndView errorHtml(HttpServletRequest request, HttpServletResponse response) { HttpStatus status = this.getStatus(request); Map model = Collections.unmodifiableMap(this.getErrorAttributes(request, this.getErrorAttributeOptions(request, MediaType.TEXT_HTML))); response.setStatus(status.value()); ModelAndView modelAndView = this.resolveErrorView(request, response, status, model); return modelAndView != null ? modelAndView : new ModelAndView("error", model); } mv.addObject("message","안녕하세요"); 혹시 이부분이 최종적으로 new ModelAndView("error", model);의 model에 담기기때문에 model의 데이터가 담기는걸까요?

Lượt thích
0
Số bình luận
3
Lượt xem
677