In the payment section of our website, I get from the bank its paymentPage URL and paymentID. After that I have to redirect the client browser to the bank paymentPage URL using POST method, not GET. Just to note that the bank paymentPage URL is offsite, it is not connected with our server.
I couldn't find a smart solution in JSF 1.2 & Spring that deals the problem. One trivial solution is to create a simple jsf page with the following body(using JavaScript):
<body OnLoad="OnLoadEvent();">
<form action="<%=url %>" method="post" name="form1">
<input type="hidden" name="PaymentID" value="<%=paymentId %>" />
</form>
<script language="JavaScript">
function OnLoadEvent() {
document.form1.submit();
}
</script>
Can you give me any better solution using the JavaServet API, JSF and Spring APIs?
In my opinion, in the Controller I have a method proceedToPayment() where I will take from ServletContext(or FacesContext) the Request object. But after that I have no idea how to forward paymentPage URL using POST method.
P.S. It seems that it is a more general question. I found a similar query for ASP here.