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

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

無法實(shí)例化的行動(dòng),cn.star.ssh.action.productaction

Unable to instantiate Action, cn.star.ssh.action.ProductAction, defined for 'product_save' in namespace '/'null

正在回答

8 回答

我換成jdk1.6也沒用,用老師的第二種方法就沒問題了

0 回復(fù) 有任何疑惑可以回復(fù)我~

明明昨天用jdk1.8還好好的,今天就出問題了

0 回復(fù) 有任何疑惑可以回復(fù)我~

出現(xiàn)這種問的童鞋,jdk換到1.6就行了,要用1.8的話,spring要用4

6 回復(fù) 有任何疑惑可以回復(fù)我~
#1

理工喵的故事

是這樣的,我改用1.7也過了。。。
2016-11-05 回復(fù) 有任何疑惑可以回復(fù)我~
#2

理工喵的故事

我想問下,你是怎么知道的? 要不是看到你這里,估計(jì)這問題解決不了。
2016-11-05 回復(fù) 有任何疑惑可以回復(fù)我~
#3

慕粉3988581

強(qiáng)! 同問:為什么?
2016-12-22 回復(fù) 有任何疑惑可以回復(fù)我~

// Struts和Spring整合過程中按名稱自動(dòng)注入業(yè)務(wù)層的類

private ProductService productService;


public void setProductService(ProductService productService) {

this.productService = productService;

}

感覺是這句話沒有起作用

http://img1.sycdn.imooc.com//57fc9f2f0001bbe602360067.jpg

可是jar包已經(jīng)導(dǎo)入了啊

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

Night離

重新放到lib目錄下試試
2017-03-01 回復(fù) 有任何疑惑可以回復(fù)我~

package cn.star.ssh.action;



import com.opensymphony.xwork2.ActionSupport;

import com.opensymphony.xwork2.ModelDriven;


import cn.star.ssh.entity.Product;

import cn.star.ssh.service.ProductService;


/**

?* 商品管理的Action的類

?*/

public class ProductAction extends ActionSupport implements ModelDriven<Product>{

/**

*?

*/

private static final long serialVersionUID = 1L;

// 模型驅(qū)動(dòng)使用的類

private Product product = new Product();

@Override

public Product getModel() {

return product;

}

// Struts和Spring整合過程中按名稱自動(dòng)注入業(yè)務(wù)層的類

private ProductService productService;


public void setProductService(ProductService productService) {

this.productService = productService;

}


/**

* 保存商品的執(zhí)行的方法:save

*/

public String save(){

System.out.println("Action中的save方法執(zhí)行了...");

productService.save(product);

return NONE;

}

}


0 回復(fù) 有任何疑惑可以回復(fù)我~

沒搞懂哪里錯(cuò)了?

0 回復(fù) 有任何疑惑可以回復(fù)我~

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"

xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:jee="http://www.springframework.org/schema/jee"

xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jpa="http://www.springframework.org/schema/data/jpa"

xsi:schemaLocation="

http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd

http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd

http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd

http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.2.xsd

http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd

http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd">



<!-- 配置業(yè)務(wù)層的類 -->

<bean id="productService" class="cn.star.ssh.service.ProductService">

<property name="productDao" ref="productDao"></property>

</bean>

<!-- 配置DAO的類 -->

<bean id="productDao" class="cn.star.ssh.dao.ProductDao">

</bean>

</beans>


0 回復(fù) 有任何疑惑可以回復(fù)我~

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE struts PUBLIC

? ? "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"

? ? "http://struts.apache.org/dtds/struts-2.3.dtd">

<!-- Struts2配置 -->

<struts>

<package name="ssh" extends="struts-default" namespace="/">?

<action name="product_save" class="cn.star.ssh.action.ProductAction" method="save">

</action>

</package>

? ??

</struts>


0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

無法實(shí)例化的行動(dòng),cn.star.ssh.action.productaction

我要回答 關(guān)注問題
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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