第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

org.springframework.beans.BeanInstantiation

org.springframework.beans.BeanInstantiation

梵蒂岡之花 2022-08-03 16:14:15
我正在使用彈簧靴。我的道實(shí)現(xiàn)是:public void saveDetails(Proforma_Invoice proforma) {    Session session = null;    Transaction tx = null;    try {        session = sessionFactory.openSession();        tx = session.beginTransaction();        session.saveOrUpdate(proforma);        tx.commit();    } catch (Exception e) {        e.printStackTrace();    } finally {        if (session != null && session.isOpen())            session.flush();        if (session != null && session.isOpen())            session.close();    }}我的控制器是: @RequestMapping(value = "/enquiry", method = RequestMethod.GET)    public ModelAndView getEnquiryScreen(Model model, Item_entity item, Integer item_code, vendor_entity vendor) {        System.out.println("Controller is starting..");        ModelAndView mav = new ModelAndView("enquiry_Screen");        return mav;    }    @RequestMapping(value = "/enquiry", method = RequestMethod.POST)    public ModelAndView demo(@ModelAttribute("enquiry") Model model, Item_entity item, Integer item_code,            vendor_entity vendor, Proforma_Invoice proforma) {        System.out.println("Controller is starting..");        ModelAndView mav = new ModelAndView("enquiry_Screen"););        return mav;    }當(dāng)我保存數(shù)據(jù)時(shí)使用這些,然后我得到錯(cuò)誤:2019-03-12 09:45:34.352 ERROR 7256 --- [nio-8080-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.ui.Model]: Specified class is an interface] with root causeorg.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.ui.Model]: Specified class is an interface請(qǐng)參閱問(wèn)題。并幫助我解決問(wèn)題。
查看完整描述

1 回答

?
翻過(guò)高山走不出你

TA貢獻(xiàn)1875條經(jīng)驗(yàn) 獲得超3個(gè)贊

您正在嘗試混合使用 作為控制器參數(shù)并使用 . 當(dāng)您有一個(gè)包含來(lái)自傳入請(qǐng)求的參數(shù)的表單對(duì)象,并且您希望 Spring 將這些參數(shù)復(fù)制到該對(duì)象的實(shí)例中時(shí),將使用該對(duì)象。將表單對(duì)象用于 POST 映射(一個(gè)好主意),或者刪除注釋以使用 。Model@ModelAttribute@ModelAttributeModel



查看完整回答
反對(duì) 回復(fù) 2022-08-03
  • 1 回答
  • 0 關(guān)注
  • 113 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)