LookupDispatchAction - getKeyMethodMap() must be implemented error even though it has been implemented.

Posted on 2006-11-07
Last Modified: 2012-06-27
Hi Experts,

I am trying to create dispatch action and I don't know why it is complaining. I still get getKeyMethodMap() must be implemented error message.
Here is what I did.

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.beanutils.PropertyUtils;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import javax.servlet.ServletException;
import org.apache.struts.actions.LookupDispatchAction;
import java.util.*;

public class IndividualTestAction extends LookupDispatchAction {

    protected Map getKeyMethodMap(ActionMapping mapping,
            ActionForm form,
            HttpServletRequest request) {
          Map map = new HashMap();
          map.put("button.basc", "basc");
          map.put("button.prs", "prs");
          return map;
    public ActionForward basc(ActionMapping mapping,
            ActionForm form,
            HttpServletRequest request,
            HttpServletResponse response)
          throws IOException, ServletException {
          return mapping.findForward("basc");

    public ActionForward prs(ActionMapping mapping,
            ActionForm form,
            HttpServletRequest request,
            HttpServletResponse response)
            throws IOException, ServletException {
          return mapping.findForward("success");
any idea?
Question by:dkim18
LVL 23

Accepted Solution

Ajay-Singh earned 200 total points
ID: 17891287
you need to implement a method something like:

protected java.util.Map getKeyMethodMap()  {

Assisted Solution

owenli27 earned 100 total points
ID: 17891596
change your method to:
protected Map getKeyMethodMap( ) {
          Map map = new HashMap();
          map.put("button.basc", "basc");
          map.put("button.prs", "prs");
          return map;

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
couple of eclipse 5 54
Error in @AspectJ Based AOP with Spring 2 24
SequenceInputStream example 3 22
Tomcat 9 + java 8 error while trying to deploy a war file 2 732
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question