我想集成一个支付网关。在加密用户输入后,我想用POST方法将数据和数据一起提交到支付网关页面。但是重定向不起作用。 这是它们的示例代码。但是我想在控制器中弄错它,并从控制器而不是从jsp重定向
<head><title>Sample Transaction
File</title></head>
<body>
<%@ page import = "java.io.*, com.ccavenue.transaction.util.AesCryptUtil" %>
<%@include file="libFunctions.jsp"%>
<%
String merchant_id = "2193"; //Put your merchant id here
String access_code = " F94007DF164870D69A"; //Put access code here
String enc_key = "FABE114254BDBC7823534894FF789FCCC1"; //Put encryption key here
Enumeration enumeration=request.getParameterNames ();
String ccaRequest="", pname="", pvalue="";
while (enumeration.hasMoreElements ()) {
pname = ""+enumeration.nextElement ();
pvalue = request.getParameter (pname);
ccaRequest = ccaRequest + pname + "=" + pvalue + "&";
}
AesCryptUtil aesUtil=new AesCryptUtil (enc_key);
String encRequest=aesUtil.encrypt (ccaRequest);
%>
<form method="post" name="redirect" action="https://test.ccavenue.com/transaction/transaction.do?
command= initiateTransaction"/>
<input type="hidden"
id="encRequest" name="encRequest" value="<%= encRequest %>">
<input type="hidden" name="access_code" id="access_code" value="<%= access_code %>">
<script language='javascript'>document.redirect.submit ();. </script>
</form>
</body>
</html>