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

Posted on 2006-11-07
Medium Priority
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 java.io.IOException;
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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 23

Accepted Solution

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

protected java.util.Map getKeyMethodMap()  {

Assisted Solution

owenli27 earned 400 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month8 days, 22 hours left to enroll

764 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