What is the cgi-bin equivalent of getRequestDispatcher ("/ myURL"). Forward (request, response)?
2 answers
Doing a redirect would be easy. Just return the correct HTTP header like:
Location: http://www.w3.org/pub/WWW/People.html
The problem is that the user will see the URL change in their browser.
Technically, a "redirect" is an internal redirect, which is usually supported by your framework (ie the servlet API you specify). I think to get "inner-forward" to work in #! / Bin / sh you will need to do something like this (psuedocode)
# before i've printed anything to the output
if "should i forward"
my_other_cgi_page.sh
exit
fi
+2
source to share