SpringMVC04:数据处理及跳转

页面跳转的方式
一、ModelAndView<.h3>
设置ModelAndView对象 , 根据view的名称 , 和视图解析器跳到指定的页面 .
页面 : {视图解析器前缀} + viewName +{视图解析器后缀}
二、ServletAPI<.h3>
通过设置ServletAPI , 不需要视图解析器 .
注意: Tomcat启动后确定加载出index.jsp页面
1、通过HttpServletResponse进行输出
@RequestMapping("m1/t1")
public void test(HttpServletRequest req, HttpServletResponse resp) throws IOException {
resp.getWriter().println("hello");
}

2、通过HttpServlet

SpringMVC04:数据处理及跳转最先出现在Python成神之路

版权声明:
作者:cc
链接:https://www.techfm.club/p/20025.html
来源:TechFM
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>