What is the cgi-bin equivalent of getRequestDispatcher ("/ myURL"). Forward (request, response)?

I am using #! / Bin / sh as my language.

+2


source to share


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


I'll just call it like

myURL

      



because all the CGI data will be in environment variables (not sure about the POST request though)

0


source







All Articles