課程
/后端開發(fā)
/Java
/2小時學(xué)會Spring Boot
想請教下springboot下不使用模板引擎怎么進(jìn)行html頁面重定向?(使用springboot默認(rèn)的項(xiàng)目結(jié)構(gòu))
2017-01-16
源自:2小時學(xué)會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://idcbgp.cn"); ????} }
zackma 提問者
舉報
Spring Boot入門視頻教程,你將學(xué)會使用Spring Boot快速構(gòu)建應(yīng)用程序
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2017-01-17