return "redirect:주소" vs return "view이름" 의 차이

·2023년 11월 8일

*궁금한 점
controller에서 return "list"라고 할때와 return "redirect:list"의 차이는 뭘까?

1.return "view이름"
return "list"라고 할 경우에는 list.jsp를 리턴

2.return "redirect:주소"
return "redirect:golist"로 할경우에는 golist.jsp파일을 찾는 게 아니라 컨트롤러 안에서 url이 golist인 메소드를 찾아감.

요청url은 localhost:8081/이었으나 엔터치면 localhost:8081/golist로 변경됨

profile
냐홍

0개의 댓글