久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      java后端如何實(shí)現(xiàn)頁面跳轉(zhuǎn)

      java后端如何實(shí)現(xiàn)頁面跳轉(zhuǎn)

      頁面跳轉(zhuǎn)分類有兩種:重定向和轉(zhuǎn)發(fā),即redirectforward。

      一:重定向redirect

      第一種方式:controller中返回值為String

      相關(guān)免費(fèi)學(xué)習(xí)視頻分享:java在線學(xué)習(xí)

      public String login(HttpServletRequest req, HttpServletResponse resp) return "redirect:http://localhost:8080/index";

      第二種方式:controller中返回值為void

      public void login(HttpServletRequest req, HttpServletResponse resp) resp.sendRedirect("http://localhost:8080/index");

      第三種方式:controller中返回值為ModelAndView

      return new ModelAndView("redirect:/toList");

      二:轉(zhuǎn)發(fā)forward

      例如:

      request.getRequestDispatcher("/student_list.jsp").forward(request, response);

      相關(guān)文章教程推薦:java入門教程

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號