gpt4 book ai didi

java - BindingResult 和 bean 名称 'configId' 的普通目标对象都不能用作请求属性 Jasper 异常

转载 作者:太空宇宙 更新时间:2023-11-04 06:21:26 25 4
gpt4 key购买 nike

我正在开发 Spring CRUD 应用程序。在我的列表屏幕中,我有一个编辑按钮,当单击编辑按钮时,它必须重定向到我有表单输入字段的另一个页面。我要编辑的内容将被加载到那里。

在我正在使用的jsp中

<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>

当我单击编辑图标时,我收到此错误:

Neither BindingResult nor plain target object for bean name 'configId' available as request attribute Jasper Exception

这是我的 update.jsp 代码

 <form:form action="updateContact.do" commandname="FeedUpdate" method="post"></form:form>
<div class="small-3 columns">
<label for="right-label" class="right inline">Config Id</label>
</div>

<div class="small-9 columns">
<form:input path="configId" readonly="true"></form:input>
</div>

<div class="row">
<div class="small-3 columns">
<label for="right-label" class="right inline">Feed Id</label>
</div>

<div id="val" class="small-9 columns">
<form:input path="feedId" readonly="true"></form:input>
</div>

这是我的 Java Controller 类

@RequestMapping(value="/updateFeed", method=RequestMethod.GET)
public ModelAndView edit(@RequestParam("key")Integer id)
{
FeedForm feedForm = new FeedForm();

ModelAndView mav = new ModelAndView("FeedUpdate");

FeedFormDAO feedFormDAO = new FeedFormDAO();
feedForm = feedFormDAO.selectFeed(String.valueOf(id));

mav.addObject("FeedUpdate", feedForm);
return mav;
}

最佳答案

检查“configId”是否作为属性(以及有效的 getter 和 setter)存在于您的 FeedForm .java

关于java - BindingResult 和 bean 名称 'configId' 的普通目标对象都不能用作请求属性 Jasper 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27376342/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com