No action instance for path /foobar could be created

C

crash.test.dummy

I have these classes:

=========================================
samples.test.ListAction.java

public class ListAction extends DispatchAction {
public ActionForward init(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws
Exception {...}
....
}

=========================================
samples.app.struts.PersonViewAction.java

public class PersonViewAction extends ListAction {
public ActionForward init(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws
Exception {...
...
return super.init(mapping, form, request, response);
}
....
}

=========================================
samples.app.struts.PersonViewActionForm.java

public class PersonViewActionForm extends ActionForm {
....
}

=========================================
struts-config.xml

<form-beans>
<form-bean name="personViewActionForm"
type="samples.app.struts.PersonActionForm"/>
</form-beans>

<action-mappings>
<action path="/personViewAction"
type="samples.app.struts.PersonViewAction"
name="personViewActionForm"
scope="request"
input="/searchPage.jsp"
parameter="method">
<forward name="success" path="/resultsPage.jsp" />
</action>

=========================================

running this app with URL (i am using weblogic v8.1):

http://localhost/myTestPage/personViewAction.do?method=init

causes this error

ERROR~org.apache.struts.action.RequestProcessor~ No action instance
for path /personViewAction could be created


However, when I make PersonViewAction extend DispatchAction directly,
everything works fine.

Any reason why I cannot extend the PersonViewAction with ListAction and
still make things work just fine?


I checked the .war file and and the classes are properly located:
/WEB-INF/classes/samples/test/ListAction.class
/WEB-INF/classes/samples/app/struts/PersonViewAction.class

I'm trying to handle pagination in ListAction so pages that needs
pagination will just have their Action classes extend from ListAction
(and not repeat the logic over and over again).

any help is appreciated.
thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top