I am trying to implement LookupDispatchAction in my code. I am trying to display another page when I click a button, but it doesn't forward to the new page. I don't think it even goes into the method. Kindly help.
My code is as follows:
Struts-config
<action name="CountySummaryForm"
path="/CountySummary"
scope="session"
parameter="action"
input="/pages/SumByCounty.jsp"
type="com.odps.eta.TransReports.action.CountySummaryAction">
<forward name="sumByCounty" path="/pages/SumByCounty.jsp"/>
<forward name="query1" path="/pages/tmp.jsp"/>
</action>
jsp page
<html:form action="/CountySummary">
<html:submit property="action">
<bean:message key="button.reports.query1"/>
</html:submit>
<INPUT TYPE=RESET VALUE="Clear">
</html:form>
action class
public class CountySummaryAction extends LookupDispatchAction {
protected Map getKeyMethodMap() {
log.info("In side map");
Map map = new HashMap();
map.put("button.reports.query1", "query1");
return map;
}
public ActionForward query1(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
return mapping.findForward("query1");
}
}