日期:2014-05-17  浏览次数:20638 次

普通html中<form>标签和struts2中<s:form>标签action属性的不同
普通html中<form>标签和struts2中<s:form>标签action属性值不同到底有什么不同呢?
看个例子:

运用struts2标签<s:form>
<s:form action="paymentMsg!searchPaymentMsg.do" method="post">


运用html标签<form>
<form action="/user/paymentMsg!searchPaymentMsg.do" method="post">


说明:
user是struts2配置文件package标签的命名空间,paymentMsg是action的name属性值,searchPaymentMsg是action类中的方法名!

结论:
运用struts2标签的时候注意路径,因为struts2标签<s:form>默认的将struts2配置文件中的<package>标签中的 namespace属性值自动添加了。