Tag: submit button

如何检测在单个Action类中的多个提交button场景中单击的提交button?

我有一个表单中的一个jsp。 有两个提交button:“search”和“添加新的”button。 <s:form name="searchForm" action="employeeAction" method="post"> <s:textfield name="id" label="Employee ID"/> <s:textfield name="name" label="Employee Name"/> <s:submit value="Search"/> <s:submit value="Add New"/> </s:form> 在struts.xml <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"> <struts> <constant name="struts.enable.DynamicMethodInvocation" value="false" /> <constant name="struts.devMode" value="true" /> <package name="default" namespace="/" extends="struts-default"> <default-action-ref name="index" /> <global-results> <result name="error">/error.jsp</result> </global-results> […]