How to forward the requestdispatcher to a remote URL

后端 未结 3 2128
遥遥无期
遥遥无期 2021-01-03 02:15

Am having a HTML page http://www.mywebapp.com/sample.html which is used from remote server. am passing the HTML URL as hidden form like this in the same HTML fo

3条回答
  •  粉色の甜心
    2021-01-03 02:29

    You cant forward to a different server.

    You can use the resp.sendRedirect(url)

    http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletResponse.html#sendRedirect%28java.lang.String%29

    method instead which will return a 302 redirect to the specified URL.

提交回复
热议问题