Use component scanning as given below, if com.project.action.PasswordHintAction
is annotated with stereotype annotations
<context:component-scan base-package="com.project.action"/>
EDIT
I see your problem, in PasswordHintActionTest
you are autowiring PasswordHintAction
. But you did not create bean configuration for PasswordHintAction
to autowire. Add one of stereotype annotation(@Component, @Service, @Controller
) to PasswordHintAction
like
@Component
public class PasswordHintAction extends BaseAction {
private static final long serialVersionUID = -4037514607101222025L;
private String username;
or create xml configuration in applicationcontext.xml
like
<bean id="passwordHintAction" class="com.project.action.PasswordHintAction" />