.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映射吧

posted @ 2017-01-29 22:47  戴林甫  阅读(8079)  评论(1编辑  收藏  举报