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
http://www.mywebapp.com/sample.html
You cant forward to a different server.
You can use the resp.sendRedirect(url)
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.