Action自定义方法代码: //处理save submit按钮的动作 public String save()throws Exception{ request.setAttribute("result", "成功保存["+msg+"]"); return "save"; } //处理print submit按钮的动作 public String print()throws Exception{ request.setAttribute("result", "成功打印["+msg+"]"); return "print"; } struts.xml配置文件代码: <!-- 使用通配符 --> <action name="Submit_*" class="com.action.MoreSubmitAction" method="{1}"> <result name="{1}">/{1}.jsp</result> </action> Jsp页面表单部分代码: <s:form action="Submit_print"> <s:textfield name="msg">输入内容</s:textfield> <s:submit name="print" value="打印"/> </s:form> <s:form action="Submit_save"> <s:textfield name="msg">输入内容</s:textfield> <s:submit name="save" value="保存"/> </s:form> 实现效果: