melih
melih

Reputation: 31

Struts 2 Spring 3 integration , action class not found

When I am trying to add different methods which are defined in CustomerAction class, system enters the method but after executing the method, Struts couldn't detect the class bean name:

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>

action class :

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";
}

application context:

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

</bean>

Upvotes: 2

Views: 2711

Answers (1)

Vibhor Bhardwaj
Vibhor Bhardwaj

Reputation: 3091

I had same exception and just including struts2-spring-plugin-2.3.16.1.jar into build path solved my problem.

Upvotes: 2

Related Questions