java的LookupDispatchAction 用法

1.html 代码

 <html:form action="/test" method="post">
     <html:submit property="action">
            <bean:message key="toone"/>
      </html:submit><br>风之境地
     <html:submit property="action">
            <bean:message key="totwo"/>
     </html:submit>
  </html:form>
2.java 代码

public ActionForward one(ActionMapping mapping, ActionForm form,
   HttpServletRequest request, HttpServletResponse response)
{
    TestForm testForm = (TestForm) form;
    return mapping.findForward("toone");
}
public ActionForward two(ActionMapping mapping, ActionForm form,
   HttpServletRequest request, HttpServletResponse response)
{
    TestForm testForm = (TestForm) form;
    return mapping.findForward("totwo");
}
 @Override
 protected Map getKeyMethodMap()
{Java split用法
   Map map = new HashMap();
   map.put("toone", "one");
   map.put("totwo", "two");
   return map;
 }

你可能感兴趣的:(java的LookupDispatchAction 用法)