读书人

struts2: Form表单有多个submit的提交

发布时间: 2012-08-22 09:50:34 作者: rapoo

struts2: Form表单有多个submit的提交问题

页面中传的是Buser对象,BuserBean的属性为:
???? private String URealname;
??? private String USex;
??? private String UTel;
??? private String UQq;
添加get、set方法。

1.register.jsp
?? <!--
??? s:submit中的method属性和struts.xml中action标签中的method属性一致(method属性指定了要调用的方法)。
???? 在s:submit中可以为一个action设置多个method,而在struts.xml中action标签中只能设置一个method。
???? 当然,在struts.xml中可以为一个action指定多个actionName(action别名)。
???? 总结:一个Action类,可以对应多个action别名,每个action别名对应多个method属性(通过s:submit标签设置)。
???? -->

?
2.struts.xml

?
3.com.dgy.action.UserAction

??

读书人网 >软件架构设计

热点推荐