I'm following Ted's tip (http://husted.com/struts/tips/003.html) but I can't get to work:

With the newest nightly build I'm getting the following error:

500 Servlet Exception
javax.servlet.ServletException: Action[/administrator] missing resource
'button.search' in key method map
at org.apache.struts.actions.LookupDispatchAction.getLookupMapName(LookupDispatchAction.java:283)
at org.apache.struts.actions.LookupDispatchAction.getMethodName(LookupDispatchAction.java:324)
at org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:201)
....


The form:
...
<html:form method="get" action="/administrator">
<html:submit property="myaction">button.search</html:submit>
...
</html:form>
...

The resulting request:
http://localhost:8080/fonde/administrator.do?myaction=button.search

struts-config.xml:
...
<action
 path="/administrator"
 type="fonde.webedit.AdministratorAction"
 name="administratorForm"
 scope="request"
 input="/pages/administrator.jsp"
 parameter="myaction">
 <forward name="admSearchDone" path="/pages/administrator.jsp"/>
</action>
...

AdministratorAction:

public class AdministratorAction extends LookupDispatchAction {

        protected Map getKeyMethodMap() {
                Map map = new HashMap();
                map.put("button.search", "search");
                System.out.println((String)map.get("button.search"));
                return map;
        }

        public ActionForward search(ActionMapping mapping,
                                ActionForm form,
                                HttpServletRequest req,
                                HttpServletResponse res) {
                ...
                return mapping.findForward("admSearchDone");
        }
}

The println() writes "search" on the console, so I know that the getKeyMethodMap()-method is invoked and the mapping should be ok.

So why can't it find my search-method?

The 1.1 release build also fails, but with another error message (this is probably due to bug 21226 (http://issues.apache.org/bugzilla/show_bug.cgi?id=21226)).


Best regards


Soeren Hjarlvig




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to