本文共 4851 字,大约阅读时间需要 16 分钟。
@RequestMapping value 能够反复吗 [问题点数:40分,结帖人wangqiao4j]
不显示删除回复显示全部回复 显示星级回复显示得分回复 仅仅显示楼主
-
-
- wangqiao4j
- 本版等级:
- 结帖率:100%
-
| 楼主 发表于: 2014-08-13 10:41:31 在同一项目中的同一个java文件里,两个方法的@RequestMapping value 能够反复吗?求大神解答。 -
<iframe id="iframeu1636200_0" src="http://pos.baidu.com/ucrm? rdid=1636200&dc=2&exps=112101&di=u1636200&dri=0&dis=0&dai=2&ps=722x246&dcb=BAIDU_SSP_define&dtm=BAIDU_DUP_SETJSONADSLOT&dvi=0.0&dci=-1&dpt=none&tsr=0&tpr=1458875265242&ti=%40RequestMapping%20value%20%E5%8F%AF%E4%BB%A5%E9%87%8D%E5%A4%8D%E5%90%97-CSDN%E8%AE%BA%E5%9D%9B-CSDN.NET-%E4%B8%AD%E5%9B%BD%E6%9C%80%E5%A4%A7%E7%9A%84IT%E6%8A%80%E6%9C%AF%E7%A4%BE%E5%8C%BA&ari=1&dbv=2&drs=3&pcs=1071x466&pss=1071x3133&cfv=0&cpl=4&chi=1&cce=true&cec=UTF-8&tlm=1458875269&ltu=http%3A%2F%2Fbbs.csdn.net%2Ftopics%2F390858539&ltr=https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DNID3EiQ5_Ka05WhVUkmbNnomKM8Pv-_K2_9pOzYiIy2omErhSxZoR8FY92yeXyST%26wd%3D%26eqid%3Db7f150e80002c40a0000000556f4ab41&ecd=1&psr=1366x768&par=1366x728&pis=-1x-1&ccd=24&cja=false&cmi=6&col=zh-CN&cdo=-1&tcn=1458875269&qn=0f80c33c57806f79&tt=1458875265213.4121.4469.4470" width="200" height="22" align="center,center" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" allowtransparency="true" style="box-sizing: content-box; border-width: 0px; border-style: initial; vertical-align: bottom; margin: 0px;"></iframe> -
<iframe id="iframeu1636201_0" src="http://pos.baidu.com/ucrm?rdid=1636201&dc=2&exps=112101&di=u1636201&dri=0&dis=0&dai=3&ps=722x500&dcb=BAIDU_SSP_define&dtm=BAIDU_DUP_SETJSONADSLOT&dvi=0.0&dci=-1&dpt=none&tsr=0&tpr=1458875265242&ti=%40RequestMapping%20value%20%E5%8F%AF%E4%BB%A5%E9%87%8D%E5%A4%8D%E5%90%97-CSDN%E8%AE%BA%E5%9D%9B-CSDN.NET-%E4%B8%AD%E5%9B%BD%E6%9C%80%E5%A4%A7%E7%9A%84IT%E6%8A%80%E6%9C%AF%E7%A4%BE%E5%8C%BA&ari=1&dbv=2&drs=3&pcs=1071x466&pss=1071x3133&cfv=0&cpl=4&chi=1&cce=true&cec=UTF-8&tlm=1458875269&ltu=http%3A%2F%2Fbbs.csdn.net%2Ftopics%2F390858539&ltr=https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DNID3EiQ5_Ka05WhVUkmbNnomKM8Pv-_K2_9pOzYiIy2omErhSxZoR8FY92yeXyST%26wd%3D%26eqid%3Db7f150e80002c40a0000000556f4ab41&ecd=1&psr=1366x768&par=1366x728&pis=-1x-1&ccd=24&cja=false&cmi=6&col=zh-CN&cdo=-1&tcn=1458875269&qn=b677067e7f9b6e2d&tt=1458875265213.4123.4514.4557" width="200" height="22" align="center,center" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" allowtransparency="true" style="box-sizing: content-box; border-width: 0px; border-style: initial; vertical-align: bottom; margin: 0px;"></iframe> -
<iframe id="iframeu1636204_0" src="http://pos.baidu.com/ucrm?rdid=1636204&dc=2&exps=112101&di=u1636204&dri=0&dis=0&dai=4&ps=722x754&dcb=BAIDU_SSP_define&dtm=BAIDU_DUP_SETJSONADSLOT&dvi=0.0&dci=-1&dpt=none&tsr=0&tpr=1458875265242&ti=%40RequestMapping%20value%20%E5%8F%AF%E4%BB%A5%E9%87%8D%E5%A4%8D%E5%90%97-CSDN%E8%AE%BA%E5%9D%9B-CSDN.NET-%E4%B8%AD%E5%9B%BD%E6%9C%80%E5%A4%A7%E7%9A%84IT%E6%8A%80%E6%9C%AF%E7%A4%BE%E5%8C%BA&ari=1&dbv=2&drs=3&pcs=1071x466&pss=1071x3133&cfv=0&cpl=4&chi=1&cce=true&cec=UTF-8&tlm=1458875269&ltu=http%3A%2F%2Fbbs.csdn.net%2Ftopics%2F390858539&ltr=https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DNID3EiQ5_Ka05WhVUkmbNnomKM8Pv-_K2_9pOzYiIy2omErhSxZoR8FY92yeXyST%26wd%3D%26eqid%3Db7f150e80002c40a0000000556f4ab41&ecd=1&psr=1366x768&par=1366x728&pis=-1x-1&ccd=24&cja=false&cmi=6&col=zh-CN&cdo=-1&tcn=1458875269&qn=f397f9e86acd773c&tt=1458875265213.4124.4611.4646" width="200" height="22" align="center,center" vspace="0" hspace="0" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" allowtransparency="true" style="box-sizing: content-box; border-width: 0px; border-style: initial; vertical-align: bottom; margin: 0px;"></iframe> |
|
-
-
- 阿卡的郎
- 本版等级:
-
| 得分:0 回复于: 2014-08-13 12:12:20 不能够吧。假设反复的话 程序执行时 它知道要提交到哪个Controller么? |
|
-
-
- 我是小小小小程序媛
- 本版等级:
-
| 得分:0 回复于: 2014-08-13 12:44:31 你反复value,编译是肯定不会报你的错的,可是到时候请求跳转到那个controller的方法。就得看天意了。你能够摆香桌,插三香祈祷跳到正确方法里。 |
|
-
-
- whos2002110
- 本版等级:
-
| 得分:20 回复于: 2014-08-13 14:10:23 value反复是能够的。 但method属性就不能一样了, 必需是不同的方式。一个get,一个post才行 |
|
-
-
- S117
- 本版等级:
-
| 得分:20 回复于: 2014-08-13 14:37:04 |
|
-
-
- byourfan
- 本版等级:
-
| 得分:0 回复于: 2014-08-13 15:19:07 就像方法重载一样,方法名能够同样。方法名和參数列表加在一起是一个方法签名 |
|
-
-
- wangqiao4j
- 本版等级:
-
| 得分:0 回复于: 2014-08-14 10:57:45 我刚測试下,value反复是能够的, 但method属性就不能一样了。 必需是不同的方式,一个get。一个post才行,这样确实能够的,感谢各位大神的帮助 |
转载于:https://www.cnblogs.com/llguanli/p/8320662.html