Struts 中的POST 小问题,请高手指点,谢谢~!

来源:百度知道 编辑:UC知道 时间:2024/05/31 04:06:16
A、B、C三台服务器都在异地。A手动提交把数据POST到B,B再自动提交数据POST到C 。在这个过程中,B可以正常接收A手动提交数据,但是C却收不到B自动提交的数据。B、C的程序代码都是没有问题的,我怀疑是不是C那边对数据阻止了,或者是B转发到第三方需要什么设置吧,请高手指点我一下,不知道是什么原因!

这是B POST 的JSP
<%@ page contentType="text/html; charset=GBK" %>
<%

String EncryptMsg=(String)request.getAttribute("EncryptMsg");
String returnUrl="http://59.41.103.109:8080/transdemo/test_ecs.do";

%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>发送查询数据</title>
</head>
<body topmargin="0" leftmargin="0" scroll="no" rightmargin="0" bottommargin="0">
<form name="frmPost" method="post" action="<%=returnUrl%>">

这样是不可以的,这样的话就会把returnUrl的值跟在你的项目的名后面了。
应该使用直接跳转的方式
<script language="javascript">
var EncryptMsg= document.frmPost.EncryptMsg.value;
window.location.href='<%=returnUrl%>'+"?EncryptMsg="+EncryptMsg;
</script>

不过这个里边的'<%=returnUrl%>'好像不应该这么写,我也忘了,你试试吧

你把数据直接跟在url后面试一下,估计是因为是不同的项目,所以数据才没有传过去。