Hi, I'm trying to code an ecommerce site with all the validation done in my
servlet. The example they give is just to use a static web page, which is no good for me. So I'm basically trying to duplicate in a servlet what the static one does. Theres nothing special about the static one:
<FORM METHOD="POST" ACTION="https://secure.example.com/authorize/process.cgi" onsubmit="return validator(this)">
<INPUT TYPE=hidden NAME="merchant" VALUE="$merchant">
<INPUT TYPE=hidden NAME="amount" VALUE="$amount">
<INPUT TYPE=hidden NAME="orderref" VALUE="$orderref">
..
</FORM>
My form calls my the validation servlet to populate the vars, then I'm trying to pass them all onto the merchant site exactly as if the user clicked the submit button in the above form. I can't use res.sendRedirect("https://secure.example.com/authorize/process.cgi") or all the params get lost. If I try grabbing the url, adding all the params and doing a POST manually, it does work but the browser never leaves my site, in other words the POST returns the output from the merchant site as a webpage stream, which means the users browser sees the content of the page with the url of my site, not the merchants. Hope I've explained this right, thanks. Heres that POST code, which works but isn't a redirect:
[Edit by Dave to add code tags]
[ March 19, 2006: Message edited by: David O'Meara ]