2013-09-29 3 views
2

Когда я пытаюсь добавить разные методы, которые определены в классе CustomerAction, система вводит метод, но после выполнения метода Struts не смог определить имя класса:Struts 2 Spring 3 интеграция, класс действия не найден

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> 
+0

Вы используете DMI? –

ответ

2

У меня было то же самое исключение и только в том числе struts2-весна-плагин-2.3.16.1.jar в путь сборки решить мою проблему.

Смежные вопросы