.do和.action的区别


因为我之前学过structs2和springmvc,structs2默认的是以.action为后缀,springmvc是以.do为后缀。structs1也是.do。网上查了下。这两者并没什么区别,只是名字不同而已。

structs2修改为.do后缀的方法如下:

可以在struts.xml中costant标签中,设置“struts.action.extension”的值为do即可。。

    <constant name="struts.action.extension" value="do"/>

并且value可以设置成任意值。比如.hello,.haha。你开心就好

springmvc我现在还不知道怎么改。但是controller可以接收.html和.do。在web.xml里配置servlet-mapping映射吧


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM