V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
esolve
V2EX  ›  问与答

Springmvc 里 @RequestMapping 的 path 里花括号里有冒号的作用是什么?

  •  
  •   esolve · 2017-04-28 16:25:22 +08:00 · 5629 次点击
    这是一个创建于 2571 天前的主题,其中的信息可能已经有所发展或是发生改变。

    如下

    @requestMapping("/consumers/{client:server}/goods") public class ConsumerGoods{ .... }

    这个{client:server}是啥意思? 谢谢!

    4 条回复    2017-04-28 17:28:52 +08:00
    zhuyao
        1
    zhuyao  
       2017-04-28 17:07:22 +08:00
    猜测是 client:server 你可以写成 127.0.0.1:192.x.x.x
    esolve
        2
    esolve  
    OP
       2017-04-28 17:20:46 +08:00
    @zhuyao 我意思是,这个冒号啥意思?
    luulsj
        3
    luulsj  
       2017-04-28 17:28:19 +08:00
    在下面的网址搜索,URI Template Patterns with Regular Expressions
    https://docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.html
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1865 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 16:30 · PVG 00:30 · LAX 09:30 · JFK 12:30
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.