Java Struts表单和请求属性为空(Struts 1.3)

Java Struts表单和请求属性为空(Struts 1.3),java,struts,Java,Struts,我遇到了一个小问题,但在过去的8年里没有做过Struts:D。。。有人能指出我的代码有什么问题吗?提交可以吗?我只是不知道为什么我的ProcessPaymentAction会收到一个参数为null的请求和一个值为null的表单 这是我的struts-config.xml文件 <action-mappings> <action path="/wpa" type="org.springframework.web.struts.DelegatingAc

我遇到了一个小问题,但在过去的8年里没有做过Struts:D。。。有人能指出我的代码有什么问题吗?提交可以吗?我只是不知道为什么我的ProcessPaymentAction会收到一个参数为null的请求和一个值为null的表单

这是我的struts-config.xml文件

    <action-mappings>
    <action path="/wpa"
        type="org.springframework.web.struts.DelegatingActionProxy" name="wpaForm"
        scope="session" input="page.wpa" validate="false">
        <forward name="success" path="page.success" />
    </action>

    <action path="/wpa2"
        type="org.springframework.web.struts.DelegatingActionProxy" name="wpaForm"
        scope="session" input="page.wpa2" validate="false">
        <forward name="success" path="page.success" />
    </action>
以下是提交页面时调用的操作

    @Override
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request,
        HttpServletResponse reponse) throws Exception {

    if (log.isDebugEnabled()) {
        log.debug("Entering ProcessPaymentAction");
    }

    WPAForm wpaForm = (WPAForm) form;

    JSONObject json = new JSONObject();

    String sessionId = request.getParameter("sessionId");
    String amount = request.getParameter("amount");
    String policyID = request.getParameter("policyID");
在这里,我的表单和所有参数都是空的

这是提交表单的jsp

  <html:form action="/wpa2" styleId="wpaForm" method="post">
}

我的表格

public class WPAForm extends ActionForm {

/**
 * 
 */
private static final long serialVersionUID = 7519298876451952530L;

private String policyID;

private String amount;

private String storeID;

public String getPolicyID() {
    return policyID;
}

public void setPolicyID(String policyID) {
    this.policyID = policyID;
}

public String getStoreID() {
    return storeID;
}

public void setStoreID(String storeID) {
    this.storeID = storeID;
}
public String getAmount() {
    return amount;
}

public void setAmount(String amount) {
    this.amount = amount;
}

完全不相关,但是
log.debug
做的第一件事是调用
isDebugEnabled
。在启用了
包装器中包装
log.debug
调用的唯一好处是,如果log语句足够复杂,应该跳过它。对于非构造的日志语句,例如字符串,它只是无用的噪音。至少需要查看表单声明和您实际提交的操作配置。我以为我已经把所有内容。。。添加了我的表单。你看到你是如何提交一个完全不同的动作,因为你通过JavaScript更改了动作吗?我们需要这些动作的声明,表单没有任何字段,即使有,也应该填充动作表单,因为Struts 1.3支持动作表单bean的概念。它应该被正确地配置为工作,但是发布的信息不足以看到它是如何参与的。不同的对象具有不同的功能,如果代码太旧,那么使用Struts 1.3重构它是无用的,但最好使用Struts 2从头重写它。
function submitForm() {

var theForm = document.getElementById("wpaForm");
if (planType == 'B') {
    theForm.action = "processhpcipayment.do";
} else if (planType == 'E') {
    theForm.action = "processmonthly.do";
}
document.getElementById("wpaForm").submit();
public class WPAForm extends ActionForm {

/**
 * 
 */
private static final long serialVersionUID = 7519298876451952530L;

private String policyID;

private String amount;

private String storeID;

public String getPolicyID() {
    return policyID;
}

public void setPolicyID(String policyID) {
    this.policyID = policyID;
}

public String getStoreID() {
    return storeID;
}

public void setStoreID(String storeID) {
    this.storeID = storeID;
}
public String getAmount() {
    return amount;
}

public void setAmount(String amount) {
    this.amount = amount;
}