2

クラスで定義されているさまざまなメソッドを追加しようとするとCustomerAction、システムはメソッドに入りますが、メソッドを実行した後、Struts はクラス Bean 名を検出できませんでした。

Invalid action class configuration that references an unknown class named [customerActionBean]

struts.xml:

<constant name="struts.devMode" value="false" />    
<package name="myPack" extends="struts-default">
    <action name="customerAction" class="customerActionBean">
        <result name="successView">/success.jsp</result>
    </action>
    <action name="welcome" class="customerActionBean" method="welcome">
        <result name="successView">/index2.jsp</result>
    </action>
</package>

アクション クラス :

public String execute() throws Exception {
    customerService.addCustomer(customer);
    savedCustomerList=customerService.getCustomers();
    return "successView";
}

public String welcome(){
    System.out.println("girdiiiiiii");
    savedCustomerList=customerService.getCustomers();
    return "succesView";
}

アプリケーション コンテキスト:

<bean id="customerActionBean" class="com.thecafetechno.CustomerAction" >
    <property name="customerService" ref="CustomerService" />

</bean>
4

1 に答える 1

2

同じ例外があり、struts2-spring-plugin-2.3.16.1.jar をビルド パスに含めるだけで問題が解決しました。

于 2014-05-18T18:28:26.667 に答える