Getting Error when trying to Use the LookupDispatchAction class

R

Ritchie

I am getting the following error when trying to press all my buttons
on my jsp. I am using the Struts framework and taking advance of
using LookupDispatchAction class since I want many actions in my HTML
form.

SEVERE: Action[/submit] does not contain method named query

**************
JSP file
**************
<html:submit property="method">
<bean:message key="button.query" />
</html:submit>

<html:submit property="method">
<bean:message key="button.change" />
</html:submit>


******************
Struts-config.xml
******************
<action-mappings type="org.apache.struts.action.ActionMapping">
<!-- Static pages -->
<action path="/submit"
type="ca.halifax.internal.phonebook.controller.PhoneAction"
name="phoneform" scope="request" input="phonescreen.jsp"
parameter="method" validate="false">
<forward name="success" path="phonescreen.jsp" />
</action>

*********************
Action class
*********************
public final class PhoneAction extends LookupDispatchAction {
private ActionForward query(ActionMapping mapping,
ActionForm actionForm, HttpServletRequest request,
HttpServletResponse response) {
System.out.println("Performing Query operation");
return mapping.findForward("success");
}

....
protected Map getKeyMethodMap() {
Map map = new HashMap();
System.out.println("Inside the Mapping method");
map.put("button.query", "query");
map.put("button.change", "save");
map.put("button.first", "first");
map.put("button.previous", "previous");
map.put("button.next", "next");
map.put("button.last", "last");
map.put("button.delete", "delete");
map.put("button.add", "add");
return map;
}

Can anyone shed some light on why I am getting this error?

Thanks
Ritchie
 

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,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top