?
Solved

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

Posted on 2006-11-07
2
Medium Priority
?
485 Views
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 {
          System.out.println("basc");
          return mapping.findForward("basc");
        }

    public ActionForward prs(ActionMapping mapping,
            ActionForm form,
            HttpServletRequest request,
            HttpServletResponse response)
            throws IOException, ServletException {
            System.out.println("prs");
          return mapping.findForward("success");
        }
}
++++++++++++
any idea?
0
Comment
Question by:dkim18
2 Comments
 
LVL 23

Accepted Solution

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

protected java.util.Map getKeyMethodMap()  {
}
0
 
LVL 9

Assisted Solution

by:owenli27
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;
        }
0

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

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month15 days, 4 hours left to enroll

839 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