Java Struts2 框架页面传参问题就

jsp页面 这是动态生成 拼接的代码

if($(v).attr("checked")){
var shufeidiv=$("#shoufei_"+id).html();
if(shufeidiv==null||shufeidiv==""){
var shoufieDetails=$("#shoufieDetails");
var div0=shoufieDetails.html();
div0+="

";
div0+=""+name+"";
div0+="";
div0+="";
div0+="";
div0+="";
div0+="";
div0+="";
div0+="";
div0+="
"+name+"率:";
div0+='';
div0+="";
div0+="
费率计算天数:";
div0+="";
div0+="请选择...";
div0+="";
div0+="
";
div0+="
";
alert(div0);
shoufieDetails.html(div0);
make_select_data(6,'tianshu'+id);
index++;
}
action 代码 :

@Controller("addFundInvestAction")
@Scope("prototype")
public class AddFundInvestAction extends BaseSupportAction {
/**
*
*/
private static final long serialVersionUID = 1L;
@Autowired
FundInvestService fundInvestService;
@Autowired
private FundProjectService fundProjectService;
FundInvest fundInvest;//基金对象
List fAccount=new ArrayList(); //这是页面传来的集合
@Override
public String _execute() throws Exception {
    //投资所属产品
    FundProject fundProject = fundProjectService.findFundProjectById(Long.valueOf(23713));
    FundUtil.setNullWhenDataValueIdIsNull(fundInvest);
    FundUtil.setNullWhenDataValueIdIsNull(fundProject);
    fundInvest.setFundInvestAccounts(new HashSet<FundInvestAccount>(fAccount));
    fundInvest.setFundProject(fundProject);
    DataValue tzzt = new DataValue();
    tzzt.setDataValueId(Long.valueOf(7306));
    fundInvest.setTzzt(tzzt);
    fundInvestService.addFundInvest(fundInvest);
    return Action.SUCCESS;
}

提交表单的时候报错:
2015-06-08 10:28:18,948 [http-8080-1] WARN [com.opensymphony.xwork2.ognl.OgnlValueStack] - Error setting expression 'fAccount[0].costtypepart.costTypePartID' with value '[Ljava.lang.String;@189e397'
ognl.OgnlException: source is null for getProperty(null, "0")

2015-06-08 10:28:18,958 [http-8080-1] WARN [com.opensymphony.xwork2.ognl.OgnlValueStack] - Error setting expression 'fAccount[0].feilv' with value '[Ljava.lang.String;@671e1'
ognl.OgnlException: source is null for getProperty(null, "0")

2015-06-08 10:28:18,961 [http-8080-1] WARN [com.opensymphony.xwork2.ognl.OgnlValueStack] - Error setting expression 'fAccount[0].jsts.dataValueId' with value '[Ljava.lang.String;@1ccc63'
ognl.OgnlException: source is null for getProperty(null, "0")

2个回答

你一步一步调试一下嘛,看看在哪儿出错了。

字符串拼的有问题,你调试一下

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问