課程
/后端開發
/Java
/2小時學會Spring Boot
想請教下springboot下不使用模板引擎怎么進行html頁面重定向?(使用springboot默認的項目結構)
2017-01-16
源自:2小時學會Spring Boot 2-1
正在回答
import?org.springframework.web.bind.annotation.GetMapping; import?org.springframework.web.bind.annotation.ResponseBody; import?org.springframework.web.bind.annotation.RestController; import?org.springframework.web.servlet.ModelAndView; /** ?*?@version?1.0?2017/1/17 ?*?@since?1.0 ?*/ @RestController public?class?HelloController?{ ????@GetMapping(value?=?"/hello") ????@ResponseBody ????public?ModelAndView?say()?{ ????????return?new?ModelAndView("redirect:http://www.xianlaiwan.cn"); ????} }
zackma 提問者
舉報
Spring Boot入門視頻教程,你將學會使用Spring Boot快速構建應用程序
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2017-01-17