当前位置: 代码迷 >> HTML/CSS >> 普普通通html中<form>标签和struts2中<s:form>标签action属性的不同
  详细解决方案

普普通通html中<form>标签和struts2中<s:form>标签action属性的不同

热度:33   发布时间:2012-11-04 10:42:41.0
普通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属性值自动添加了。







  相关解决方案